[−][src]Struct cron_tab::Cron
Implementations
impl<Z> Cron<Z> where
Z: Send + Sync + 'static,
Z: TimeZone,
<Z as TimeZone>::Offset: Send,
[src]
Z: Send + Sync + 'static,
Z: TimeZone,
<Z as TimeZone>::Offset: Send,
Cron contains and executes the scheduled jobs.
pub fn new(tz: Z) -> Cron<Z>
[src]
Create a new cron.
ⓘThis example is not tested
let mut cron = cron::Cron::new(Utc); cron.add_fn("* * * * * *", || { println!("anonymous fn"); }).unwrap(); cron.start();
pub fn add_fn<T>(&mut self, spec: &str, f: T) -> Result<i32, CronError> where
T: 'static,
T: FnMut() + Send + Sync,
[src]
T: 'static,
T: FnMut() + Send + Sync,
Add a function to Cron.
ⓘThis example is not tested
let mut cron = cron::Cron::new(Utc); cron.add_fn("* * * * * *", || { println!("anonymous fn"); }).unwrap(); cron.start();
pub fn set_timezone(&mut self, tz: Z)
[src]
Set timezone offset.
ⓘThis example is not tested
let mut cron = cron::Cron::new(Utc); cron.start();
pub fn remove(&self, id: i32)
[src]
Remove a job from Cron.
ⓘThis example is not tested
let mut cron = cron::Cron::new(); let job_id = cron.add_fn("* * * * * *", || { println!("anonymous fn"); }).unwrap(); cron.start(); cron.remove(job_id);
pub fn stop(&self)
[src]
Stop Cron.
ⓘThis example is not tested
let mut cron = cron::Cron::new(); let job_id = cron.add_fn("* * * * * *", || { println!("anonymous fn"); }).unwrap(); cron.start(); cron.stop();
pub fn start(&mut self)
[src]
Start cron. A thead will be spawn for schedule jobs
ⓘThis example is not tested
let mut cron = cron::Cron::new(Utc); let job_id = cron.add_fn("* * * * * *", || { println!("anonymous fn"); }).unwrap(); cron.start();
Trait Implementations
impl<Z: Clone> Clone for Cron<Z> where
Z: Send + Sync + 'static,
Z: TimeZone,
<Z as TimeZone>::Offset: Send,
[src]
Z: Send + Sync + 'static,
Z: TimeZone,
<Z as TimeZone>::Offset: Send,
Auto Trait Implementations
impl<Z> RefUnwindSafe for Cron<Z> where
Z: RefUnwindSafe,
Z: RefUnwindSafe,
impl<Z> Send for Cron<Z>
impl<Z> Sync for Cron<Z>
impl<Z> Unpin for Cron<Z> where
Z: Unpin,
<Z as TimeZone>::Offset: Unpin,
Z: Unpin,
<Z as TimeZone>::Offset: Unpin,
impl<Z> UnwindSafe for Cron<Z> where
Z: UnwindSafe,
Z: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,