JobBuilder

Trait JobBuilder 

Source
pub trait JobBuilder<Args> {
Show 17 methods // Required methods fn new() -> Self; fn and(&mut self) -> &mut Self; fn repeat_seq(&mut self, n: u32, interval: Interval) -> &mut Self; fn repeat_async(&mut self, n: u32, interval: Interval) -> &mut Self; fn get_mut_cron_builder(&mut self) -> &mut JobScheduleBuilder; fn get_mut_since(&mut self) -> &mut (i32, u32, u32, u32, u32, u32); // Provided methods fn at(&mut self, interval: Interval) -> &mut Self { ... } fn since_every(&mut self, start: Interval, interval: Interval) -> &mut Self { ... } fn every(&mut self, interval: Interval) -> &mut Self { ... } fn from_to(&mut self, start: Interval, end: Interval) -> &mut Self { ... } fn at_datetime( &mut self, year: Option<i32>, month: Option<u32>, day: Option<u32>, hour: Option<u32>, min: Option<u32>, sec: Option<u32>, ) -> &mut Self { ... } fn at_time(&mut self, hour: u32, min: u32, sec: u32) -> &mut Self { ... } fn at_date(&mut self, year: i32, month: u32, day: u32) -> &mut Self { ... } fn since_datetime( &mut self, year: i32, month: u32, day: u32, hour: u32, min: u32, sec: u32, ) -> &mut Self { ... } fn since_date(&mut self, year: i32, month: u32, day: u32) -> &mut Self { ... } fn since_time(&mut self, hour: u32, min: u32, sec: u32) -> &mut Self { ... } fn after(&mut self, delay: u64) -> &mut Self { ... }
}

Required Methods§

Source

fn new() -> Self

Constructs a new job builder

Source

fn and(&mut self) -> &mut Self

Specify another time the task will run

Source

fn repeat_seq(&mut self, n: u32, interval: Interval) -> &mut Self

The task will run n times in sequence. You need to specify the number and the interval between tasks.

Source

fn repeat_async(&mut self, n: u32, interval: Interval) -> &mut Self

Spawn n tasks at the same time. You need to specify the number and the interval between tasks.

Source

fn get_mut_cron_builder(&mut self) -> &mut JobScheduleBuilder

Usually not use it directly, use at_* and since_* is better

Source

fn get_mut_since(&mut self) -> &mut (i32, u32, u32, u32, u32, u32)

Provided Methods§

Source

fn at(&mut self, interval: Interval) -> &mut Self

Specify a specific run time, equivalent to cron ‘n’

Source

fn since_every(&mut self, start: Interval, interval: Interval) -> &mut Self

Specify a specific run time, equivalent to the corn expression ‘m/n’

Source

fn every(&mut self, interval: Interval) -> &mut Self

Specify a specific run time, equivalent to the corn expression ‘0/n’

Source

fn from_to(&mut self, start: Interval, end: Interval) -> &mut Self

Specify a specific run time, equivalent to the corn expression ‘m-n’

Source

fn at_datetime( &mut self, year: Option<i32>, month: Option<u32>, day: Option<u32>, hour: Option<u32>, min: Option<u32>, sec: Option<u32>, ) -> &mut Self

Specify a specific run time, the same as at

Source

fn at_time(&mut self, hour: u32, min: u32, sec: u32) -> &mut Self

Specify a specific run time, the same as at

Source

fn at_date(&mut self, year: i32, month: u32, day: u32) -> &mut Self

Specify a specific run time, the same as at

Source

fn since_datetime( &mut self, year: i32, month: u32, day: u32, hour: u32, min: u32, sec: u32, ) -> &mut Self

Specify the datetime after which the task will start, the same as since

Source

fn since_date(&mut self, year: i32, month: u32, day: u32) -> &mut Self

Specify the date after which the task will start, the same as since

Source

fn since_time(&mut self, hour: u32, min: u32, sec: u32) -> &mut Self

Specify the time after which the task will start, the same as since

Source

fn after(&mut self, delay: u64) -> &mut Self

Specify when the task will start after, like since

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Args> JobBuilder<Args> for AsyncJobBuilder<Args>

Source§

impl<Args> JobBuilder<Args> for SyncJobBuilder<Args>