Holiday

Struct Holiday 

Source
pub struct Holiday {
    pub id: i32,
    pub uid: String,
    pub name: Vec<Text>,
    pub date: Time,
    pub url: Url,
    pub country: Option<Country>,
    pub locations: Option<String>,
    pub states: Option<Vec<HolidayState>>,
    pub oneliner: Option<Vec<Text>>,
    pub types: Option<Vec<String>>,
}
Expand description

A holiday event.

Fields§

§id: i32

Identifier for the holiday definition. Please note that this id is not unique, not even with a single year - the same holiday event may be returned multiple times because it is observed on a different day, or because it is scheduled in a different calendar (Hebrew or Muslim calendar) and happens multiple times within a Gregorian year. Use the uid attribute for purposes where you need a unique identifier.

§uid: String

Id for the shown holiday instance. The id is designed to be unique across all holiday instances generated by the timeanddate.com API services and respects different calendars and other reasons that may cause events to occur multiple times within one Gregorian year.

§name: Vec<Text>

List of holiday/observance names.

§date: Time

Date/time of the holiday instance. Most holidays do not have a specific time - in this case the time components will be skipped. Some special events like equinoxes and solstices include the exact time of the event as well, in this case the timestamp will be in local time zone (including time zone data) (countries with multiple timezones: local time in capital city).

§url: Url

Further information about the specific holiday. The Url points to the timeanddate.com web page.

Example: https://www.timeanddate.com/holidays/us/new-year-day

§country: Option<Country>

Country of the holiday instance.

§locations: Option<String>

Summary of locations where this holiday instance is valid. Element is only present if the holiday instance does not affect the whole country.

§states: Option<Vec<HolidayState>>

States/subdivisions that are affected by this holiday instance. This element is only present if the holiday instance is not valid in the whole country.

§oneliner: Option<Vec<Text>>

List of holiday/observance descriptions.

§types: Option<Vec<String>>

Classification of the holiday. Most days have only one classification, but some have multiple types associated. This happens e.g. in conjunction with religious days that also are flag days.

Example: National Holiday

Trait Implementations§

Source§

impl Debug for Holiday

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Holiday

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. 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> 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, 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,