pub trait DatabaseInterfaceFeedTrait: Pingable {
// Required methods
fn get_current_timestamp(
&mut self,
) -> Result<NaiveDateTime, SqlInterfaceError>;
fn get_past_feedschedule_entries_from_database(
&mut self,
) -> Result<Option<Vec<FeedScheduleEntry>>, SqlInterfaceError>;
fn insert_feed_event(
&mut self,
timestamp: NaiveDateTime,
feeder_run_time: f64,
profile_name: String,
profile_id: i32,
) -> Result<(), SqlInterfaceError>;
fn get_single_feedpattern_from_database(
&mut self,
profile_id: i32,
) -> Result<Feedpattern, SqlInterfaceError>;
fn update_feedschedule_entries_in_database(
&mut self,
feedschedule_entries: &mut Vec<FeedScheduleEntry>,
) -> Result<(), SqlInterfaceError>;
}Expand description
Trait for interfacing between feed and SQL database This trait is prerequisite to use mock implementation for testing