Skip to main content

LanguageData

Struct LanguageData 

Source
pub struct LanguageData {
Show 19 fields pub code: &'static str, pub name: &'static str, pub months_long: &'static [&'static str; 12], pub months_short: &'static [&'static str; 12], pub weekdays_long: &'static [&'static str; 7], pub weekdays_short: &'static [&'static str; 7], pub am_indicators: &'static [&'static str], pub pm_indicators: &'static [&'static str], pub ago_words: &'static [&'static str], pub future_words: &'static [&'static str], pub future_prefix: &'static [&'static str], pub past_prefix: &'static [&'static str], pub special_words: &'static [(SpecialWord, &'static [&'static str])], pub last_words: &'static [&'static str], pub next_words: &'static [&'static str], pub this_words: &'static [&'static str], pub time_units: &'static [(TimeUnit, &'static [&'static str])], pub number_words: &'static [(&'static str, i64)], pub date_order: DateOrder,
}
Expand description

Language-specific data for parsing and formatting dates.

All string data is &'static and compiled directly into the binary.

Fields§

§code: &'static str

ISO 639-1 language code (e.g. “en”, “zh”)

§name: &'static str

Human-readable language name

§months_long: &'static [&'static str; 12]§months_short: &'static [&'static str; 12]§weekdays_long: &'static [&'static str; 7]§weekdays_short: &'static [&'static str; 7]§am_indicators: &'static [&'static str]§pm_indicators: &'static [&'static str]§ago_words: &'static [&'static str]

Words that appear after <n> <unit> to indicate the past (e.g. “ago”)

§future_words: &'static [&'static str]

Words that appear after <n> <unit> to indicate the future (e.g. “from now”, “later”)

§future_prefix: &'static [&'static str]

Prefixes that appear before <n> <unit> to indicate the future (e.g. “in”)

§past_prefix: &'static [&'static str]

Prefixes that appear before <n> <unit> to indicate the past (e.g. “hace” in Spanish, “il y a” in French, “vor” in German)

§special_words: &'static [(SpecialWord, &'static [&'static str])]§last_words: &'static [&'static str]§next_words: &'static [&'static str]§this_words: &'static [&'static str]§time_units: &'static [(TimeUnit, &'static [&'static str])]§number_words: &'static [(&'static str, i64)]§date_order: DateOrder

Trait Implementations§

Source§

impl Debug for LanguageData

Source§

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

Formats the value using the given formatter. 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.