pub struct Scheduler { /* private fields */ }
Expand description
A scheduler for managing and executing events based on their activation time.
Implementations§
Source§impl Scheduler
impl Scheduler
Sourcepub fn get_event_count(&self) -> usize
pub fn get_event_count(&self) -> usize
Gets the count of events in the scheduler’s queue.
Sourcepub fn schedule_date(&mut self, end_date: DateTime<Utc>, func: EventFunc)
pub fn schedule_date(&mut self, end_date: DateTime<Utc>, func: EventFunc)
Adds a new event that activates at a certain date.
Sourcepub fn schedule_wait_from_now(&mut self, wait: Duration, func: EventFunc)
pub fn schedule_wait_from_now(&mut self, wait: Duration, func: EventFunc)
Adds a new event that activates after a certain duration from the current time.
Sourcepub fn schedule_event(&mut self, event: Event)
pub fn schedule_event(&mut self, event: Event)
Adds a new event to the scheduler.
Auto Trait Implementations§
impl Freeze for Scheduler
impl !RefUnwindSafe for Scheduler
impl !Send for Scheduler
impl !Sync for Scheduler
impl Unpin for Scheduler
impl !UnwindSafe for Scheduler
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