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]

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]

type Err = CronParsingError

The associated error which can be returned from parsing.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.