Struct SyncJob

Source
pub struct SyncJob<Args> { /* private fields */ }

Implementations§

Source§

impl<Args> SyncJobBuilder<Args>
where Args: Clone + 'static + Send,

Source

pub fn run<Tz, F>(&mut self, f: F) -> Box<dyn Job<Tz> + Send + 'static>
where F: SyncHandler<Args> + Send + 'static + Copy, Tz: TimeZone + Clone + Send + Sync + Copy + 'static, <Tz as TimeZone>::Offset: Send + Sync,

Constructs a new sync job

Trait Implementations§

Source§

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

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 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)

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 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

Auto Trait Implementations§

§

impl<Args> Freeze for SyncJobBuilder<Args>

§

impl<Args> RefUnwindSafe for SyncJobBuilder<Args>
where Args: RefUnwindSafe,

§

impl<Args> Send for SyncJobBuilder<Args>
where Args: Send,

§

impl<Args> Sync for SyncJobBuilder<Args>
where Args: Sync,

§

impl<Args> Unpin for SyncJobBuilder<Args>
where Args: Unpin,

§

impl<Args> UnwindSafe for SyncJobBuilder<Args>
where Args: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.