[][src]Struct white_rabbit::Scheduler

pub struct Scheduler { /* fields omitted */ }

This scheduler exists on two levels: The handle, granting you the ability of adding new tasks, and the executor, dating and executing these tasks when specified time is met.

Info: This scheduler may not be precise due to anomalies such as preemption or platform differences.

Methods

impl Scheduler[src]

pub fn add_task_datetime<T>(&mut self, time: DateTime<Utc>, to_execute: T) where
    T: FnMut(&mut Context) -> DateResult + Send + Sync + 'static, 
[src]

Add a task to be executed when time is reached.

pub fn add_task_duration<T>(&mut self, how_long: ChronoDuration, to_execute: T) where
    T: FnMut(&mut Context) -> DateResult + Send + Sync + 'static, 
[src]

impl Scheduler[src]

pub fn new(thread_count: usize) -> Self[src]

Creates a new Scheduler which will use thread_count number of threads when tasks are being dispatched/dated.

Trait Implementations

impl<'a> Drop for Scheduler[src]

Once the scheduler is dropped, we also need to join and finish the thread.

Auto Trait Implementations

impl Send for Scheduler

impl Sync for Scheduler

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]