pub enum Schedule {
Once(DateTime<Utc>),
Interval(Duration),
Daily(u32, u32),
Weekly(Weekday, u32, u32),
Monthly(u32, u32, u32),
Cron(String),
}Expand description
Represents a time schedule for execution
Variants§
Once(DateTime<Utc>)
Execute once at a specific time
Interval(Duration)
Execute repeatedly at fixed intervals
Daily(u32, u32)
Execute daily at a specified hour and minute (24-hour format)
Weekly(Weekday, u32, u32)
Execute weekly on a specified day at a specified hour and minute
Monthly(u32, u32, u32)
Execute monthly on a specified day at a specified hour and minute
Cron(String)
Execute according to a cron expression (not fully implemented) This is a placeholder for future implementation
Implementations§
Source§impl Schedule
impl Schedule
Sourcepub fn next_execution(&self) -> Result<DateTime<Utc>, FloxideError>
pub fn next_execution(&self) -> Result<DateTime<Utc>, FloxideError>
Calculate the next execution time based on the current time
Sourcepub fn duration_until_next(&self) -> Result<Duration, FloxideError>
pub fn duration_until_next(&self) -> Result<Duration, FloxideError>
Calculate the duration until the next execution
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Schedule
impl RefUnwindSafe for Schedule
impl Send for Schedule
impl Sync for Schedule
impl Unpin for Schedule
impl UnwindSafe for Schedule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more