DateConstraintsBuilder

Struct DateConstraintsBuilder 

Source
pub struct DateConstraintsBuilder { /* private fields */ }
Expand description

Builder for DateConstraints.

Implementations§

Source§

impl DateConstraintsBuilder

Source

pub fn min_date(&mut self, value: NaiveDate) -> &mut Self

inclusive minimal date constraint the earliest date that can be selected

Source

pub fn max_date(&mut self, value: NaiveDate) -> &mut Self

inclusive maximal date constraint the latest date that can be selected

Source

pub fn disabled_weekdays(&mut self, value: HashSet<Weekday>) -> &mut Self

disabled weekdays, that should not be selectable

Source

pub fn disabled_months(&mut self, value: HashSet<Month>) -> &mut Self

entire completely disabled months in every year

Source

pub fn disabled_years(&mut self, value: HashSet<i32>) -> &mut Self

entire completely disabled years

Source

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

Source

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

Source

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

Source

pub fn build(&self) -> Result<DateConstraints, DateConstraintsBuilderError>

Builds a new DateConstraints.

§Errors

If a required field has not been initialized.

Trait Implementations§

Source§

impl Clone for DateConstraintsBuilder

Source§

fn clone(&self) -> DateConstraintsBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for DateConstraintsBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.