Struct curds_cron::CronExpression [−][src]
pub struct CronExpression { /* fields omitted */ }
A representation of a Cron Expression.
Implementations
impl CronExpression
[src]
pub fn is_match<Tz>(&self, datetime: &DateTime<Tz>) -> bool where
Tz: TimeZone,
[src]
Tz: TimeZone,
Test whether the current CronExpression is a match for a given DateTime.
use chrono::{DateTime, Utc}; use curds_cron::CronExpression; let test_expression = "25 * * * *".parse::<CronExpression>()?; assert_eq!(false, test_expression.is_match(&"2021-04-01T00:00:00Z".parse::<DateTime<Utc>>()?)); assert_eq!(true, test_expression.is_match(&"2021-04-01T00:25:00Z".parse::<DateTime<Utc>>()?));
Trait Implementations
impl Debug for CronExpression
[src]
impl Display for CronExpression
[src]
impl FromStr for CronExpression
[src]
Auto Trait Implementations
impl RefUnwindSafe for CronExpression
impl Send for CronExpression
impl Sync for CronExpression
impl Unpin for CronExpression
impl UnwindSafe for CronExpression
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,
pub 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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
pub 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>,