pub struct DateConstraintsBuilder { /* private fields */ }
Expand description
Builder for DateConstraints
.
Implementations§
Source§impl DateConstraintsBuilder
impl DateConstraintsBuilder
Sourcepub fn min_date(&mut self, value: NaiveDate) -> &mut Self
pub fn min_date(&mut self, value: NaiveDate) -> &mut Self
inclusive minimal date constraint the earliest date that can be selected
Sourcepub fn max_date(&mut self, value: NaiveDate) -> &mut Self
pub fn max_date(&mut self, value: NaiveDate) -> &mut Self
inclusive maximal date constraint the latest date that can be selected
Sourcepub fn disabled_weekdays(&mut self, value: HashSet<Weekday>) -> &mut Self
pub fn disabled_weekdays(&mut self, value: HashSet<Weekday>) -> &mut Self
disabled weekdays, that should not be selectable
Sourcepub fn disabled_months(&mut self, value: HashSet<Month>) -> &mut Self
pub fn disabled_months(&mut self, value: HashSet<Month>) -> &mut Self
entire completely disabled months in every year
Sourcepub fn disabled_years(&mut self, value: HashSet<i32>) -> &mut Self
pub fn disabled_years(&mut self, value: HashSet<i32>) -> &mut Self
entire completely disabled years
Sourcepub fn disabled_monthly_dates(&mut self, value: HashSet<u32>) -> &mut Self
pub fn disabled_monthly_dates(&mut self, value: HashSet<u32>) -> &mut Self
disabled monthly periodically repeating dates, so it is just a day number
starting from 1 for the first day of the month
if unique dates in a certain year should not be selectable use disabled_unique_dates
Sourcepub fn disabled_yearly_dates(&mut self, value: Vec<NaiveDate>) -> &mut Self
pub fn disabled_yearly_dates(&mut self, value: Vec<NaiveDate>) -> &mut Self
disabled yearly periodically repeating dates that should not be selectable,
if unique dates in a certain year should not be selectable use disabled_unique_dates
it is a Vec
since we need to iterate over it anyway, since we hae no MonthDay type
Sourcepub fn disabled_unique_dates(&mut self, value: HashSet<NaiveDate>) -> &mut Self
pub fn disabled_unique_dates(&mut self, value: HashSet<NaiveDate>) -> &mut Self
disabled unique dates with a specific year, month and day that should not be selectable, if some periodically repeated dates should not be selectable use the correct option
Sourcepub fn build(&self) -> Result<DateConstraints, DateConstraintsBuilderError>
pub fn build(&self) -> Result<DateConstraints, DateConstraintsBuilderError>
Trait Implementations§
Source§impl Clone for DateConstraintsBuilder
impl Clone for DateConstraintsBuilder
Source§fn clone(&self) -> DateConstraintsBuilder
fn clone(&self) -> DateConstraintsBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more