pub struct UseIntlDateTimeFormatOptions { /* private fields */ }Implementations§
Source§impl UseIntlDateTimeFormatOptions
impl UseIntlDateTimeFormatOptions
Sourcepub fn locales(self, value: Vec<String>) -> Self
pub fn locales(self, value: Vec<String>) -> Self
A vec of strings, each with a BCP 47 language tag. Please refer to the MDN Docs for more info.
Sourcepub fn locale_matcher(self, value: LocaleMatcher) -> Self
pub fn locale_matcher(self, value: LocaleMatcher) -> Self
The locale matching algorithm to use. Possible values are Lookup and BestFit; the default is BestFit.
For information about this option, see the Intl page.
Sourcepub fn calendar<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Self
pub fn calendar<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
The calendar to use, such as "chinese", "gregory", "persian" etc. For a list of the
supported calendar types, see the MDN docs.
Sourcepub fn day_period<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<DayPeriodFormat>,
pub fn day_period<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<DayPeriodFormat>,
The way day periods should be expressed. This option only has an effect if a 12-hour clock
(hour_cycle H11 or H12, or hour12 is true) is used. Note that the day period may
be displayed even if the hour is not set to be displayed.
Sourcepub fn numbering_system<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Self
pub fn numbering_system<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
The numbering system to use. Possible values include: "arab", "arabext", "bali", "beng", "deva", "fullwide", "gujr", "guru", "hanidec", "khmr", "knda", "laoo", "latn", "limb", "mlym", "mong", "mymr", "orya", "tamldec", "telu", "thai", "tibt".
Sourcepub fn hour12<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Self
pub fn hour12<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
Whether to use 12-hour time (as opposed to 24-hour time). The default is locale dependent.
This option overrides the hc language tag and/or the hour_cycle option in case both are present.
Sourcepub fn hour_cycle<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Self
pub fn hour_cycle<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
The hour cycle to use. This option overrides the hc language tag, if both are present, and
the hour12 option takes precedence in case both options have been specified.
H11: hour system using 0–11; corresponds to midnight starting at 0:00 AM.H12: hour system using 1–12; corresponds to midnight starting at 12:00 AM.H23: hour system using 0–23; corresponds to midnight starting at 0:00.H24: hour system using 1–24; corresponds to midnight starting at 24:00.
Sourcepub fn time_zone<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Self
pub fn time_zone<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
The time zone to use. The only value implementations must recognize is "UTC"; the default
is the runtime’s default time zone. Implementations may also recognize the time zone names
of the IANA time zone database, such as "Asia/Shanghai",
"Asia/Kolkata", "America/New_York".
Sourcepub fn format_matcher(self, value: FormatMatcher) -> Self
pub fn format_matcher(self, value: FormatMatcher) -> Self
The format matching algorithm to use. Possible values are Basic and BestFit; the default
is BestFit. See the MDN docs
for details. Only has an effect when using the individual date-time component options
(and not UseIntlDateTimeFormatOptions::date_style / UseIntlDateTimeFormatOptions::time_style).
Sourcepub fn weekday<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<WeekdayFormat>,
pub fn weekday<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<WeekdayFormat>,
The representation of the weekday.
Long: e.g.,ThursdayShort: e.g.,ThuNarrow: e.g.,T. Two weekdays may have the same narrow style for some locales (e.g.Tuesday’s narrow style is alsoT).
Cannot be combined with UseIntlDateTimeFormatOptions::date_style / UseIntlDateTimeFormatOptions::time_style.
Sourcepub fn era<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Self
pub fn era<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
The representation of the era.
Long: e.g.,Anno DominiShort: e.g.,ADNarrow: e.g.,A
Cannot be combined with UseIntlDateTimeFormatOptions::date_style / UseIntlDateTimeFormatOptions::time_style.
Sourcepub fn year<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<YearFormat>,
pub fn year<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<YearFormat>,
The representation of the year.
Numeric: e.g.,2012TwoDigit: e.g.,12
Cannot be combined with UseIntlDateTimeFormatOptions::date_style / UseIntlDateTimeFormatOptions::time_style.
Sourcepub fn month<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<MonthFormat>,
pub fn month<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<MonthFormat>,
The representation of the month.
Numeric: e.g.,3TwoDigit: e.g.,03Long: e.g.,MarchShort: e.g.,MarNarrow: e.g.,M. Two months may have the same narrow style for some locales (e.g.May’s narrow style is alsoM).
Cannot be combined with UseIntlDateTimeFormatOptions::date_style / UseIntlDateTimeFormatOptions::time_style.
Sourcepub fn day<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Self
pub fn day<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
The representation of the day.
Numeric: e.g.,1TwoDigit: e.g.,01
Cannot be combined with UseIntlDateTimeFormatOptions::date_style / UseIntlDateTimeFormatOptions::time_style.
Sourcepub fn hour<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<TimeNumericFormat>,
pub fn hour<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<TimeNumericFormat>,
The representation of the hour.
Numeric: e.g.,1TwoDigit: e.g.,01
Cannot be combined with UseIntlDateTimeFormatOptions::date_style / UseIntlDateTimeFormatOptions::time_style.
Sourcepub fn minute<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<TimeNumericFormat>,
pub fn minute<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<TimeNumericFormat>,
The representation of the minute.
Numeric: e.g.,1TwoDigit: e.g.,01
Cannot be combined with UseIntlDateTimeFormatOptions::date_style / UseIntlDateTimeFormatOptions::time_style.
Sourcepub fn second<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<TimeNumericFormat>,
pub fn second<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<TimeNumericFormat>,
The representation of the second.
Numeric: e.g.,1TwoDigit: e.g.,01
Cannot be combined with UseIntlDateTimeFormatOptions::date_style / UseIntlDateTimeFormatOptions::time_style.
Sourcepub fn fractional_second_digits<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Self
pub fn fractional_second_digits<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
The number of digits used to represent fractions of a second (any additional digits are
truncated). Possible values are from 1 to 3.
Sourcepub fn time_zone_name<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<TimeZoneNameFormat>,
pub fn time_zone_name<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<TimeZoneNameFormat>,
The localized representation of the time zone name.
Long: long localized form (e.g.,Pacific Standard Time).Short: short localized form (e.g.:PST).ShortOffset: short localized GMT format (e.g.,GMT-8).LongOffset: long localized GMT format (e.g.,GMT-0800).ShortGeneric: short generic non-location format (e.g.:PT).LongGeneric: long generic non-location format (e.g.:Pacific Time).
Sourcepub fn date_style<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<DateTimeStyle>,
pub fn date_style<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<DateTimeStyle>,
The date formatting length. Cannot be combined with the individual date-time component
options (weekday, era, year, month, day, hour, minute, second,
fractional_second_digits, time_zone_name, day_period).
Possible values are Full, Long, Medium and Short.
Sourcepub fn time_style<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<DateTimeStyle>,
pub fn time_style<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Selfwhere
OptionInnerType: Into<DateTimeStyle>,
The time formatting length. Cannot be combined with the individual date-time component
options (weekday, era, year, month, day, hour, minute, second,
fractional_second_digits, time_zone_name, day_period).
Possible values are Full, Long, Medium and Short.
Trait Implementations§
Source§impl Default for UseIntlDateTimeFormatOptions
impl Default for UseIntlDateTimeFormatOptions
Source§fn default() -> UseIntlDateTimeFormatOptions
fn default() -> UseIntlDateTimeFormatOptions
Source§impl From<UseIntlDateTimeFormatOptions> for Object
impl From<UseIntlDateTimeFormatOptions> for Object
Source§fn from(options: UseIntlDateTimeFormatOptions) -> Self
fn from(options: UseIntlDateTimeFormatOptions) -> Self
Auto Trait Implementations§
impl Freeze for UseIntlDateTimeFormatOptions
impl RefUnwindSafe for UseIntlDateTimeFormatOptions
impl Send for UseIntlDateTimeFormatOptions
impl Sync for UseIntlDateTimeFormatOptions
impl Unpin for UseIntlDateTimeFormatOptions
impl UnsafeUnpin for UseIntlDateTimeFormatOptions
impl UnwindSafe for UseIntlDateTimeFormatOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more