#[non_exhaustive]pub struct CronExpr {
pub minutes: Expr<Minute>,
pub hours: Expr<Hour>,
pub doms: DayOfMonthExpr,
pub months: Expr<Month>,
pub dows: DayOfWeekExpr,
}Expand description
A parsed cron expression. This can be used to describe the expression or reduce it into a
Cron value.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.minutes: Expr<Minute>The minute part of the expression
hours: Expr<Hour>The hour part of the expression
doms: DayOfMonthExprThe day of the month part of the expression
months: Expr<Month>The month part of the expression
dows: DayOfWeekExprThe day of the week part of the expression.
Implementations§
Source§impl CronExpr
impl CronExpr
Sourcepub fn describe<L: Language>(&self, lang: L) -> LanguageFormatter<'_, L>
pub fn describe<L: Language>(&self, lang: L) -> LanguageFormatter<'_, L>
Returns a formatter to display the cron expression in the provided language
§Example
use saffron::parse::{CronExpr, English};
let cron: CronExpr = "* * * * *".parse().expect("Valid cron expression");
let description = cron.describe(English::default()).to_string();
assert_eq!("Every minute", description);Trait Implementations§
impl Eq for CronExpr
impl StructuralPartialEq for CronExpr
Auto Trait Implementations§
impl Freeze for CronExpr
impl RefUnwindSafe for CronExpr
impl Send for CronExpr
impl Sync for CronExpr
impl Unpin for CronExpr
impl UnwindSafe for CronExpr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more