pub struct Schedule { /* private fields */ }Expand description
The app’s scheduled tasks.
Implementations§
Source§impl Schedule
impl Schedule
Sourcepub fn every<F, Fut>(
&mut self,
interval: Duration,
name: &str,
task: F,
) -> ScheduledTask<'_>
pub fn every<F, Fut>( &mut self, interval: Duration, name: &str, task: F, ) -> ScheduledTask<'_>
Every interval, aligned to the clock (every 5 minutes runs at :00, :05, …).
Sourcepub fn every_minute<F, Fut>(&mut self, name: &str, task: F) -> ScheduledTask<'_>
pub fn every_minute<F, Fut>(&mut self, name: &str, task: F) -> ScheduledTask<'_>
Every minute, on the minute.
Sourcepub fn every_minutes<F, Fut>(
&mut self,
minutes: u64,
name: &str,
task: F,
) -> ScheduledTask<'_>
pub fn every_minutes<F, Fut>( &mut self, minutes: u64, name: &str, task: F, ) -> ScheduledTask<'_>
Every minutes minutes, aligned to the clock (every 15 runs at :00, :15, …).
Sourcepub fn hourly<F, Fut>(&mut self, name: &str, task: F) -> ScheduledTask<'_>
pub fn hourly<F, Fut>(&mut self, name: &str, task: F) -> ScheduledTask<'_>
Every hour, on the hour.
Sourcepub fn cron<F, Fut>(
&mut self,
expression: &str,
name: &str,
task: F,
) -> ScheduledTask<'_>
pub fn cron<F, Fut>( &mut self, expression: &str, name: &str, task: F, ) -> ScheduledTask<'_>
When the wall clock matches a cron expression: minute, hour, day of
month, month, day of week (0/7 or SUN), with *, a-b, lists
and /step; also @hourly, @daily, @weekly, @monthly,
@yearly. "30 9 * * 1-5" is 09:30 on weekdays.
Sourcepub fn daily_at<F, Fut>(
&mut self,
time: &str,
name: &str,
task: F,
) -> ScheduledTask<'_>
pub fn daily_at<F, Fut>( &mut self, time: &str, name: &str, task: F, ) -> ScheduledTask<'_>
Every day at HH:MM.
Sourcepub fn weekly_on<F, Fut>(
&mut self,
day: Weekday,
time: &str,
name: &str,
task: F,
) -> ScheduledTask<'_>
pub fn weekly_on<F, Fut>( &mut self, day: Weekday, time: &str, name: &str, task: F, ) -> ScheduledTask<'_>
Every week on day at HH:MM.
Sourcepub fn monthly_on<F, Fut>(
&mut self,
day: u32,
time: &str,
name: &str,
task: F,
) -> ScheduledTask<'_>
pub fn monthly_on<F, Fut>( &mut self, day: u32, time: &str, name: &str, task: F, ) -> ScheduledTask<'_>
Every month on day (1–31; months without that day are skipped, so
use 28 or lower for every month) at HH:MM.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Schedule
impl !UnwindSafe for Schedule
impl Freeze for Schedule
impl Send for Schedule
impl Sync for Schedule
impl Unpin for Schedule
impl UnsafeUnpin for Schedule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more