Trait tokio_schedule::Job [−][src]
pub trait Job: Sized + Sync { type TZ: TimeZone + Send + Sync; type UntilTZ: TimeZone + Send + Sync; fn time_to_sleep_at(&self, now: &DateTime<Self::TZ>) -> Duration; fn time_to_sleep(&self) -> Option<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, { ... } }
Expand description
This Trait represents job in timezone. It provides method perform.
Associated Types
Required methods
fn time_to_sleep_at(&self, now: &DateTime<Self::TZ>) -> Duration
[src]
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) -> Option<Duration>
[src]
fn time_to_sleep(&self) -> Option<Duration>
[src]This method returns Duration from now to next job run
Implementors
impl<TZ, UntilTZ> Job for EveryDay<TZ, UntilTZ> where
TZ: Clone + TimeZone + Send + Sync,
UntilTZ: Clone + TimeZone + Send + Sync,
UntilTZ::Offset: Sync,
[src]
impl<TZ, UntilTZ> Job for EveryDay<TZ, UntilTZ> where
TZ: Clone + TimeZone + Send + Sync,
UntilTZ: Clone + TimeZone + Send + Sync,
UntilTZ::Offset: Sync,
[src]impl<TZ, UntilTZ> Job for EveryHour<TZ, UntilTZ> where
TZ: Clone + TimeZone + Send + Sync,
UntilTZ: Clone + TimeZone + Send + Sync,
UntilTZ::Offset: Sync,
[src]
impl<TZ, UntilTZ> Job for EveryHour<TZ, UntilTZ> where
TZ: Clone + TimeZone + Send + Sync,
UntilTZ: Clone + TimeZone + Send + Sync,
UntilTZ::Offset: Sync,
[src]impl<TZ, UntilTZ> Job for EveryMinute<TZ, UntilTZ> where
TZ: Clone + TimeZone + Send + Sync,
UntilTZ: Clone + TimeZone + Send + Sync,
UntilTZ::Offset: Sync,
[src]
impl<TZ, UntilTZ> Job for EveryMinute<TZ, UntilTZ> where
TZ: Clone + TimeZone + Send + Sync,
UntilTZ: Clone + TimeZone + Send + Sync,
UntilTZ::Offset: Sync,
[src]impl<TZ, UntilTZ> Job for EverySecond<TZ, UntilTZ> where
TZ: Clone + TimeZone + Send + Sync,
UntilTZ: Clone + TimeZone + Send + Sync,
UntilTZ::Offset: Sync,
[src]
impl<TZ, UntilTZ> Job for EverySecond<TZ, UntilTZ> where
TZ: Clone + TimeZone + Send + Sync,
UntilTZ: Clone + TimeZone + Send + Sync,
UntilTZ::Offset: Sync,
[src]