Struct clokwerk::AsyncJob

source ·
pub struct AsyncJob<Tz = Local, Tp = ChronoTimeProvider>where
    Tz: TimeZone,
    Tp: TimeProvider,
{ /* private fields */ }
Expand description

An asynchronous job to run on the scheduler. Create these by calling AsyncScheduler::every().

Methods for scheduling the job live in the Job trait.

Implementations

Specify a task to run, and schedule its next run

The function passed into this method should return a value implementing Future<Output = ()>.

Run a task and re-schedule it. This is usually only called by AsyncScheduler::run_pending().

Trait Implementations

Formats the value using the given formatter. Read more
Specify the time of day when a task should run, e.g. Read more
Identical to Job::at except that it returns a Result instead of panicking if the conversion failed. Read more
Similar to Job::at, but it takes a chrono::NaiveTime instead of a &str. Because it doesn’t need to parse a string, this method will always succeed. Read more
Specifies an offset to when a task should run, e.g. Read more
Add an additional scheduling to the task. All schedules will be considered when determining when the task should next run. Read more
Execute the job only once. Equivalent to _.count(1).
Execute the job forever. This is the default behaviour.
Execute the job only count times.
After running once, run again with the specified interval. Read more
Test whether a job is scheduled to run again. This is usually only called by Scheduler::run_pending(). Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.