pub enum Scheduled {
CronPattern(String),
ScheduleOnce(DateTime<Utc>),
}
Expand description
Represents a schedule for scheduled tasks.
It’s used in the AsyncRunnable::cron
and Runnable::cron
Variants§
CronPattern(String)
A cron pattern for a periodic task
For example, Scheduled::CronPattern("0/20 * * * * * *")
ScheduleOnce(DateTime<Utc>)
A datetime for a scheduled task that will be executed once
For example, Scheduled::ScheduleOnce(chrono::Utc::now() + std::time::Duration::seconds(7i64))
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Scheduled
impl Send for Scheduled
impl Sync for Scheduled
impl Unpin for Scheduled
impl UnwindSafe for Scheduled
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> 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> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
T: SqlType + TypedExpressionType,
fn into_sql<T>(self) -> Self::Expressionwhere Self: AsExpression<T> + Sized, T: SqlType + TypedExpressionType,
Convert
self
to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
T: SqlType + TypedExpressionType,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,
Convert
&self
to an expression for Diesel’s query builder. Read more