Struct clokwerk::AsyncJob[][src]

pub struct AsyncJob<Tz = Local, Tp = ChronoTimeProvider> where
    Tz: TimeZone,
    Tp: TimeProvider
{ /* fields omitted */ }

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

impl<Tz, Tp> AsyncJob<Tz, Tp> where
    Tz: TimeZone + Sync + Send,
    Tp: TimeProvider
[src]

pub fn run<F, T>(&mut self, f: F) -> &mut Self where
    F: 'static + FnMut() -> T + Send,
    T: 'static + Future<Output = ()> + Send
[src]

Specify a task to run, and schedule its next run

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

pub fn execute(
    &mut self,
    now: &DateTime<Tz>
) -> Option<Pin<Box<dyn Future<Output = ()> + Send + 'static>>>
[src]

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

Trait Implementations

impl<Tz, Tp> Debug for AsyncJob<Tz, Tp> where
    Tz: TimeZone,
    Tp: TimeProvider
[src]

impl<Tz, Tp> Job<Tz, Tp> for AsyncJob<Tz, Tp> where
    Tz: TimeZone + Sync + Send,
    Tp: TimeProvider
[src]

Auto Trait Implementations

impl<Tz = Local, Tp = ChronoTimeProvider> !RefUnwindSafe for AsyncJob<Tz, Tp>

impl<Tz, Tp> Send for AsyncJob<Tz, Tp> where
    Tp: Send,
    Tz: Send,
    <Tz as TimeZone>::Offset: Send

impl<Tz = Local, Tp = ChronoTimeProvider> !Sync for AsyncJob<Tz, Tp>

impl<Tz, Tp> Unpin for AsyncJob<Tz, Tp> where
    Tp: Unpin,
    Tz: Unpin,
    <Tz as TimeZone>::Offset: Unpin

impl<Tz = Local, Tp = ChronoTimeProvider> !UnwindSafe for AsyncJob<Tz, Tp>

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.