HasDateConstraints

Trait HasDateConstraints 

Source
pub trait HasDateConstraints {
    // Required methods
    fn is_day_forbidden(&self, date: &NaiveDate) -> bool;
    fn is_month_forbidden(&self, year_month_info: &NaiveDate) -> bool;
    fn is_year_forbidden(&self, year: i32) -> bool;
    fn is_year_group_forbidden(&self, year: i32) -> bool;
}
Expand description

Trait that can be implemented to create your own date constraints.

Required Methods§

Source

fn is_day_forbidden(&self, date: &NaiveDate) -> bool

Returns true if the given date is forbidden.

Source

fn is_month_forbidden(&self, year_month_info: &NaiveDate) -> bool

Returns true if the entire month described by year_month_info is forbidden.

Source

fn is_year_forbidden(&self, year: i32) -> bool

Returns true if the entire given year is forbidden.

Source

fn is_year_group_forbidden(&self, year: i32) -> bool

Returns true if the entire group of years including the given year is forbidden. A group of years are inclusive intervals [1980, 1999], [2000, 2019], [2020, 2039], …

Implementors§