Skip to main content

DateTimeFormatInfoRef

Enum DateTimeFormatInfoRef 

Source
pub enum DateTimeFormatInfoRef<'a> {
    Borrowed(&'a DateTimeFormatInfo),
    Shared(Rc<DateTimeFormatInfo>),
}
Expand description

The conventions a DateTimeFormatProvider hands out: borrowed from the provider or shared.

Variants§

§

Borrowed(&'a DateTimeFormatInfo)

Conventions owned by the provider.

§

Shared(Rc<DateTimeFormatInfo>)

Shared conventions.

Methods from Deref<Target = DateTimeFormatInfo>§

Source

pub fn calendar(&self) -> GregorianCalendar

The calendar of the conventions; always the Gregorian one.

Source

pub fn short_date_pattern(&self) -> &str

The pattern of a short date (format "d").

Source

pub fn long_date_pattern(&self) -> &str

The pattern of a long date (format "D").

Source

pub fn short_time_pattern(&self) -> &str

The pattern of a short time (format "t").

Source

pub fn long_time_pattern(&self) -> &str

The pattern of a long time (format "T").

Source

pub fn full_date_time_pattern(&self) -> Cow<'_, str>

The pattern of a long date and long time (format "F"): the long date pattern, a space and the long time pattern unless set explicitly.

Source

pub fn month_day_pattern(&self) -> &str

The pattern of a month and day (format "M").

Source

pub fn year_month_pattern(&self) -> &str

The pattern of a year and month (format "Y").

Source

pub fn rfc1123_pattern(&self) -> &'static str

The pattern of the round-trip format "R" (RFC 1123).

Source

pub fn sortable_date_time_pattern(&self) -> &'static str

The pattern of the sortable format "s".

Source

pub fn universal_sortable_date_time_pattern(&self) -> &'static str

The pattern of the universal sortable format "u".

Source

pub fn am_designator(&self) -> &str

The designator of hours before noon.

Source

pub fn pm_designator(&self) -> &str

The designator of hours after noon.

Source

pub fn date_separator(&self) -> &str

The text the / specifier of a custom format produces.

Source

pub fn time_separator(&self) -> &str

The text the : specifier of a custom format produces.

Source

pub fn first_day_of_week(&self) -> DayOfWeek

The first day of the week.

Source

pub fn calendar_week_rule(&self) -> CalendarWeekRule

The rule that determines the first week of a year.

Source

pub fn day_names(&self) -> &[String; 7]

The full names of the days, indexed by DayOfWeek (Sunday first).

Source

pub fn abbreviated_day_names(&self) -> &[String; 7]

The abbreviated names of the days, indexed by DayOfWeek.

Source

pub fn shortest_day_names(&self) -> &[String; 7]

The shortest unique names of the days, indexed by DayOfWeek.

Source

pub fn month_names(&self) -> &[String; 13]

The full names of the months; the thirteenth entry is empty, as in .NET.

Source

pub fn abbreviated_month_names(&self) -> &[String; 13]

The abbreviated names of the months; the thirteenth entry is empty.

Source

pub fn get_day_name(&self, day_of_week: DayOfWeek) -> &str

The full name of a day.

Source

pub fn get_abbreviated_day_name(&self, day_of_week: DayOfWeek) -> &str

The abbreviated name of a day.

Source

pub fn get_shortest_day_name(&self, day_of_week: DayOfWeek) -> &str

The shortest name of a day.

Source

pub fn get_month_name(&self, month: i32) -> &str

The full name of a month, 1..=13. Panics for other values.

Source

pub fn get_abbreviated_month_name(&self, month: i32) -> &str

The abbreviated name of a month, 1..=13. Panics for other values.

Source

pub fn get_era_name(&self, _era: i32) -> &str

The name of the only era of the Gregorian calendar (the g specifier).

Trait Implementations§

Source§

impl Deref for DateTimeFormatInfoRef<'_>

Source§

type Target = DateTimeFormatInfo

The resulting type after dereferencing.
Source§

fn deref(&self) -> &DateTimeFormatInfo

Dereferences the value.

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> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.