pub struct JobExecutor { /* private fields */ }

Implementations§

source§

impl JobExecutor

source

pub fn new_with_local_tz() -> JobExecutor

Creates a new Executor that uses the Local time zone for the execution times evaluation. For example, the cron expressions will refer to the Local time zone.

source

pub fn new_with_utc_tz() -> JobExecutor

Creates a new Executor that uses the UTC time zone for the execution times evaluation. For example, the cron expressions will refer to the UTC time zone.

source

pub fn new_with_tz(timezone: Option<Tz>) -> JobExecutor

Creates a new Executor that uses a custom time zone for the execution times evaluation. For example, the cron expressions will refer to the specified time zone.

source

pub async fn add_job( &self, schedule: &dyn TryToScheduler, job: Job ) -> Result<(), SchedulerError>

Adds a job to the JobExecutor.

source

pub async fn add_job_with_multi_schedule( &self, schedule: &[&dyn TryToScheduler], job: Job ) -> Result<(), SchedulerError>

Adds a job to the JobExecutor.

source

pub async fn add_job_with_scheduler<S: Into<Scheduler>>( &self, schedule: S, job: Job )

Adds a job to the JobExecutor.

source

pub async fn run(&self) -> Result<JoinHandle<()>, SchedulerError>

Starts the JobExecutor

source

pub async fn stop(&self, graceful: bool) -> Result<(), SchedulerError>

Stops the JobExecutor

source

pub fn set_sleep_between_checks(&self, sleep: Duration)

Sets the sleep time between checks for pending Jobs. The default is 1 second.

Trait Implementations§

source§

impl Clone for JobExecutor

source§

fn clone(&self) -> JobExecutor

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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

§

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.