[−][src]Struct holiday::Holiday
An annually repeating calendar date. Can be either a fixed date (e.g., April 1) or an nth weekday of the month (e.g., 4th Thursday in November)
Methods
impl<S: ToString> Holiday<S>
[src]
pub fn new_fixed<M: Into<Month>>(name: S, month: M, day: u32) -> Self
[src]
Creates a new fixed date holiday
pub fn new_nth<N: Into<NthWeekday>>(
name: S,
nth: N,
weekday: Weekday,
month: u32
) -> Self
[src]
name: S,
nth: N,
weekday: Weekday,
month: u32
) -> Self
Creates a new nth weekday of the month Holiday
pub fn name(&self) -> &S
[src]
Returns a reference to the Name of the Holiday
pub fn iter(&self) -> HolidayIter<Self>
[src]
Returns an iterator over all the occurrences of a given Holiday starting at the earliest representable date.
pub fn in_year(&self, year: i32) -> NaiveDate
[src]
Determine the date of a Holiday in a given year
Trait Implementations
impl<S: ToString> BeforeAfterDate for Holiday<S>
[src]
fn after(&self, date: &NaiveDate) -> NaiveDate
[src]
fn before(&self, date: &NaiveDate) -> NaiveDate
[src]
fn after_today(&self) -> NaiveDate
[src]
fn before_today(&self) -> NaiveDate
[src]
fn first_date(&self) -> NaiveDate
[src]
fn last_date(&self) -> NaiveDate
[src]
impl<S: Clone> Clone for Holiday<S>
[src]
impl<S: Copy> Copy for Holiday<S>
[src]
impl<S: Debug> Debug for Holiday<S>
[src]
impl<S: ToString> Eq for Holiday<S>
[src]
impl<'_> FromStr for Holiday<&'_ str>
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<'h, S: ToString> IntoIterator for &'h Holiday<S>
[src]
type Item = NaiveDate
The type of the elements being iterated over.
type IntoIter = HolidayIter<'h, Holiday<S>>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<S: ToString> Ord for Holiday<S>
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<S: ToString> PartialEq<Holiday<S>> for Holiday<S>
[src]
impl<S: ToString> PartialEq<NaiveDate> for Holiday<S>
[src]
impl<S: ToString> PartialEq<NthWeekdayOfMonth> for Holiday<S>
[src]
fn eq(&self, nth: &NthWeekdayOfMonth) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<S: ToString> PartialOrd<Holiday<S>> for Holiday<S>
[src]
Auto Trait Implementations
impl<S> RefUnwindSafe for Holiday<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> Send for Holiday<S> where
S: Send,
S: Send,
impl<S> Sync for Holiday<S> where
S: Sync,
S: Sync,
impl<S> Unpin for Holiday<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for Holiday<S> where
S: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,