Struct tasklet::TaskGenerator[][src]

pub struct TaskGenerator<'a, T> where
    T: TimeZone
{ /* fields omitted */ }

Task generation structure.

It is run in the given interval, and if a new task is generated, then it is appended in the list of tasks to be executed.

Implementations

impl<'a, T> TaskGenerator<'a, T> where
    T: TimeZone + Clone
[src]

Implementation of TaskGenerator.

pub fn new<F>(
    expression: &str,
    timezone: T,
    function: F
) -> TaskGenerator<'a, T> where
    F: FnMut() -> Option<Task<'a, T>> + 'a, 
[src]

Create a new TaskGenerator instance.

Arguments

  • expression - A valid cron expression.
  • function - The discovery function.
  • timezone - The generator's timezone.

Examples

// Create a `TaskGenerator` instance.
// It will be executed at the first second of each minute.
let _task_gen = TaskGenerator::new("1 * * * * * *", chrono::Local, || Some(Task::new("* * * * * * *", None, None, chrono::Local)));

Auto Trait Implementations

impl<'a, T> !RefUnwindSafe for TaskGenerator<'a, T>[src]

impl<'a, T> !Send for TaskGenerator<'a, T>[src]

impl<'a, T> !Sync for TaskGenerator<'a, T>[src]

impl<'a, T> Unpin for TaskGenerator<'a, T> where
    T: Unpin,
    <T as TimeZone>::Offset: Unpin
[src]

impl<'a, T> !UnwindSafe for TaskGenerator<'a, T>[src]

Blanket Implementations

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

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

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

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.