pub enum Task {
Wait(u64, Option<Vec<Skip>>),
Interval(u64, Option<Vec<Skip>>),
At(Time, Option<Vec<Skip>>),
Once(OffsetDateTime, Option<Vec<Skip>>),
}Variants§
Wait(u64, Option<Vec<Skip>>)
wait seconds
Interval(u64, Option<Vec<Skip>>)
interval seconds
At(Time, Option<Vec<Skip>>)
at time
Once(OffsetDateTime, Option<Vec<Skip>>)
exact time
Implementations§
Source§impl Task
impl Task
Sourcepub fn get_next_run_time<T: Notifiable + 'static>(
&self,
timezone_minutes: i16,
) -> Option<OffsetDateTime>
pub fn get_next_run_time<T: Notifiable + 'static>( &self, timezone_minutes: i16, ) -> Option<OffsetDateTime>
get the next run time for the scheduled task
Source§impl Task
impl Task
Sourcepub fn parse(s: &str) -> Result<Self, String>
pub fn parse(s: &str) -> Result<Self, String>
Parse a task from a string with detailed error reporting.
§Examples
use easy_schedule::Task;
let task = Task::parse("wait(10)").unwrap();
match Task::parse("invalid") {
Ok(task) => println!("Success: {}", task),
Err(err) => println!("Error: {}", err),
}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Task
impl RefUnwindSafe for Task
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnwindSafe for Task
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