[][src]Struct holiday::Holiday

pub struct Holiday<S> { /* fields omitted */ }

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]

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]

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.

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?

impl<S: ToString> Ord for Holiday<S>[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]

impl<S: ToString> PartialOrd<Holiday<S>> for Holiday<S>[src]

Auto Trait Implementations

impl<S> RefUnwindSafe for Holiday<S> where
    S: RefUnwindSafe

impl<S> Send for Holiday<S> where
    S: Send

impl<S> Sync for Holiday<S> where
    S: Sync

impl<S> Unpin for Holiday<S> where
    S: Unpin

impl<S> UnwindSafe for Holiday<S> where
    S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.