Trait tokio_schedule::Job [−][src]
pub trait Job: Sized + Sync { type TZ: TimeZone + Send + Sync; fn time_to_sleep_at(&self, now: &DateTime<Self::TZ>) -> Duration; fn time_to_sleep(&self) -> Duration { ... } fn perform<'a, F, Fut>(
self,
func: F
) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>
where
Self: Send + 'a,
F: FnMut() -> Fut + Send + 'a,
Fut: Future<Output = ()> + Send + 'a,
<Self::TZ as TimeZone>::Offset: Send + 'a, { ... } }
This Trait represents job in timezone. It provides method perform.
Associated Types
Loading content...Required methods
fn time_to_sleep_at(&self, now: &DateTime<Self::TZ>) -> Duration
[src]
This method acts like time_to_sleep but with custom reference time
Provided methods
fn time_to_sleep(&self) -> Duration
[src]
This method returns Duration from now to next job run
fn perform<'a, F, Fut>(
self,
func: F
) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>> where
Self: Send + 'a,
F: FnMut() -> Fut + Send + 'a,
Fut: Future<Output = ()> + Send + 'a,
<Self::TZ as TimeZone>::Offset: Send + 'a,
[src]
self,
func: F
) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>> where
Self: Send + 'a,
F: FnMut() -> Fut + Send + 'a,
Fut: Future<Output = ()> + Send + 'a,
<Self::TZ as TimeZone>::Offset: Send + 'a,
This method returns Future that cyclic performs the job
Implementors
Loading content...