pub enum JobSchedule {
Cron {
schedule: Box<Schedule>,
tz: Tz,
},
Every {
anchor_ms: i64,
period_ms: i64,
},
Once {
at_ms: i64,
},
Manual,
}Expand description
A job’s trigger, ready to answer “when next”.
Variants§
Cron
Every
Every period_ms from anchor_ms (its creation): the first slot is
one period after it.
Once
Manual
Run now only: no slots.
Implementations§
Source§impl JobSchedule
impl JobSchedule
Sourcepub fn cron(expression: &str, tz: &str) -> Result<Self, String>
pub fn cron(expression: &str, tz: &str) -> Result<Self, String>
A standard 5-field cron expression read in tz (empty: UTC).
Sourcepub fn of(job: &CronJob) -> Result<Self, String>
pub fn of(job: &CronJob) -> Result<Self, String>
job’s trigger. A job from before triggers had kinds is cron.
Sourcepub fn after(&self, after_ms: i64) -> Box<dyn Iterator<Item = i64> + '_>
pub fn after(&self, after_ms: i64) -> Box<dyn Iterator<Item = i64> + '_>
The slots strictly after after_ms, in order.
Sourcepub fn next_after(&self, after_ms: i64) -> Option<i64>
pub fn next_after(&self, after_ms: i64) -> Option<i64>
The first slot strictly after after_ms.
Sourcepub fn prev_before(&self, before_ms: i64) -> Option<i64>
pub fn prev_before(&self, before_ms: i64) -> Option<i64>
The last slot strictly before before_ms.
Trait Implementations§
Source§impl Clone for JobSchedule
impl Clone for JobSchedule
Source§fn clone(&self) -> JobSchedule
fn clone(&self) -> JobSchedule
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for JobSchedule
impl RefUnwindSafe for JobSchedule
impl Send for JobSchedule
impl Sync for JobSchedule
impl Unpin for JobSchedule
impl UnsafeUnpin for JobSchedule
impl UnwindSafe for JobSchedule
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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