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]
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]
F: 'static + FnMut() -> T + Send,
T: 'static + Future<Output = ()> + Send,
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]
&mut self,
now: &DateTime<Tz>
) -> Option<Pin<Box<dyn Future<Output = ()> + Send + 'static>>>
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> 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]
impl<Tz, Tp> Job<Tz, Tp> for AsyncJob<Tz, Tp> where
Tz: TimeZone + Sync + Send,
Tp: TimeProvider,
[src]fn at(&mut self, time: &str) -> &mut Self
[src]
fn try_at(&mut self, time: &str) -> Result<&mut Self, ParseError>
[src]
fn at_time(&mut self, time: NaiveTime) -> &mut Self
[src]
fn plus(&mut self, ival: Interval) -> &mut Self
[src]
fn and_every(&mut self, ival: Interval) -> &mut Self
[src]
fn once(&mut self) -> &mut Self
[src]
fn forever(&mut self) -> &mut Self
[src]
fn count(&mut self, count: usize) -> &mut Self
[src]
fn repeating_every(&mut self, interval: Interval) -> Repeating<'_, Self, Tz, Tp>
[src]
fn is_pending(&self, now: &DateTime<Tz>) -> bool
[src]
Auto Trait Implementations
impl<Tz = Local, Tp = ChronoTimeProvider> !RefUnwindSafe for AsyncJob<Tz, Tp>
impl<Tz = Local, Tp = ChronoTimeProvider> !RefUnwindSafe for AsyncJob<Tz, Tp>
impl<Tz = Local, Tp = ChronoTimeProvider> !Sync for AsyncJob<Tz, Tp>
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, 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>
impl<Tz = Local, Tp = ChronoTimeProvider> !UnwindSafe for AsyncJob<Tz, Tp>