pub struct CronBuilder<T: TaskHandler> { /* private fields */ }Expand description
Builder for a typed cron entry.
Implementations§
Source§impl<T: TaskHandler> CronBuilder<T>
impl<T: TaskHandler> CronBuilder<T>
Sourcepub fn new(timer: CrontabTimer) -> Self
pub fn new(timer: CrontabTimer) -> Self
Build a typed cron entry from a custom timer.
Sourcepub fn id(self, id: impl Into<String>) -> Self
pub fn id(self, id: impl Into<String>) -> Self
Set a stable identifier for this cron entry.
Use this when more than one schedule targets the same task.
Sourcepub fn fill(self, fill: CrontabFill) -> Self
pub fn fill(self, fill: CrontabFill) -> Self
Backfill missed executions for the given duration.
Sourcepub fn max_attempts(self, max_attempts: u16) -> Self
pub fn max_attempts(self, max_attempts: u16) -> Self
Override the maximum number of attempts for jobs created by this cron.
Sourcepub fn queue(self, queue: impl Into<String>) -> Self
pub fn queue(self, queue: impl Into<String>) -> Self
Add jobs created by this cron to a named queue.
Sourcepub fn priority(self, priority: i16) -> Self
pub fn priority(self, priority: i16) -> Self
Override the priority for jobs created by this cron.
Sourcepub fn job_key_mode(self, job_key_mode: JobKeyMode) -> Self
pub fn job_key_mode(self, job_key_mode: JobKeyMode) -> Self
Set the behavior for an existing job with the same job key.
Sourcepub fn payload(self, payload: T) -> Result<Self, Error>
pub fn payload(self, payload: T) -> Result<Self, Error>
Serialize a typed task payload for jobs created by this cron.
Sourcepub fn payload_value(self, payload: impl Into<Value>) -> Self
pub fn payload_value(self, payload: impl Into<Value>) -> Self
Set a pre-built JSON payload for jobs created by this cron.
Trait Implementations§
Source§impl<T: Clone + TaskHandler> Clone for CronBuilder<T>
impl<T: Clone + TaskHandler> Clone for CronBuilder<T>
Source§fn clone(&self) -> CronBuilder<T>
fn clone(&self) -> CronBuilder<T>
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 moreSource§impl<T: TaskHandler> CronInput for CronBuilder<T>
impl<T: TaskHandler> CronInput for CronBuilder<T>
type Output = WorkerOptions
fn append_to(self, options: WorkerOptions) -> Self::Output
Source§impl<T: Debug + TaskHandler> Debug for CronBuilder<T>
impl<T: Debug + TaskHandler> Debug for CronBuilder<T>
Source§impl<T: TaskHandler> From<CronBuilder<T>> for Crontab
impl<T: TaskHandler> From<CronBuilder<T>> for Crontab
Source§fn from(builder: CronBuilder<T>) -> Self
fn from(builder: CronBuilder<T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<T> Freeze for CronBuilder<T>
impl<T> RefUnwindSafe for CronBuilder<T>
impl<T> Send for CronBuilder<T>
impl<T> Sync for CronBuilder<T>
impl<T> Unpin for CronBuilder<T>
impl<T> UnsafeUnpin for CronBuilder<T>
impl<T> UnwindSafe for CronBuilder<T>
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,
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