pub struct FeedScheduleEntry {
pub timestamp: NaiveDateTime,
pub profile_id: i32,
pub profile_name: String,
pub repeat_daily: bool,
}Expand description
Holds the data of a feed schedule entry derived from data read from the database.
Fields§
§timestamp: NaiveDateTime§profile_id: i32§profile_name: String§repeat_daily: boolImplementations§
Source§impl FeedScheduleEntry
impl FeedScheduleEntry
Sourcepub fn new(
sql_feed_schedule_entry: &SqlFeedScheduleEntry,
) -> Result<FeedScheduleEntry, SqlInterfaceError>
pub fn new( sql_feed_schedule_entry: &SqlFeedScheduleEntry, ) -> Result<FeedScheduleEntry, SqlInterfaceError>
Creates a new FeedScheduleEntry by converting raw data from an SqlFeedScheduleEntry.
This constructor takes a raw database entry (SqlFeedScheduleEntry) and
transforms it to FeedScheduleEntry. This is a critical step in
hydrating application-level structs from database records.
§Arguments
sql_feed_schedule_entry- A reference to aSqlFeedScheduleEntrystruct, containing data typically read directly from the SQL database.
§Returns
A Result containing a new, fully typed FeedScheduleEntry on success.
§Errors
Returns SqlInterfaceError::FeedScheduleEntryRepeatDailyOutOfRange if
repeat_daily is not either zero or one.
Trait Implementations§
Source§impl Clone for FeedScheduleEntry
impl Clone for FeedScheduleEntry
Source§fn clone(&self) -> FeedScheduleEntry
fn clone(&self) -> FeedScheduleEntry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FeedScheduleEntry
impl Debug for FeedScheduleEntry
Source§impl Display for FeedScheduleEntry
impl Display for FeedScheduleEntry
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Formats the FeedScheduleEntry for display.
This implementation provides a concise, single-line string representation of the schedule entry, suitable for logging and debugging. It includes the timestamp, profile ID, profile name, and daily repetition status.
§Arguments
f- A mutable reference to the formatter, as required by thefmt::Displaytrait.
§Returns
A fmt::Result containing Ok(()) if the formatting was successful.
§Errors
Returns an Err if the write! macro fails to write to the underlying
formatter. This is an uncommon error but can occur if the formatter
itself is in an error state or if the destination (e.g., a file or buffer)
reports an I/O error.