Skip to main content

UseIntlDateTimeFormatOptions

Struct UseIntlDateTimeFormatOptions 

Source
pub struct UseIntlDateTimeFormatOptions { /* private fields */ }

Implementations§

Source§

impl UseIntlDateTimeFormatOptions

Source

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.

Source

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.

Source

pub fn calendar<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
where OptionInnerType: Into<String>,

The calendar to use, such as "chinese", "gregory", "persian" etc. For a list of the supported calendar types, see the MDN docs.

Source

pub fn day_period<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
where 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.

Source

pub fn numbering_system<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
where OptionInnerType: Into<String>,

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".

Source

pub fn hour12<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
where OptionInnerType: Into<bool>,

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.

Source

pub fn hour_cycle<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
where OptionInnerType: Into<HourCycle>,

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.
Source

pub fn time_zone<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
where OptionInnerType: Into<String>,

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".

Source

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).

Source

pub fn weekday<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
where OptionInnerType: Into<WeekdayFormat>,

The representation of the weekday.

  • Long: e.g., Thursday
  • Short: e.g., Thu
  • Narrow: e.g., T. Two weekdays may have the same narrow style for some locales (e.g. Tuesday’s narrow style is also T).

Cannot be combined with UseIntlDateTimeFormatOptions::date_style / UseIntlDateTimeFormatOptions::time_style.

Source

pub fn era<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
where OptionInnerType: Into<EraFormat>,

The representation of the era.

  • Long: e.g., Anno Domini
  • Short: e.g., AD
  • Narrow: e.g., A

Cannot be combined with UseIntlDateTimeFormatOptions::date_style / UseIntlDateTimeFormatOptions::time_style.

Source

pub fn year<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
where OptionInnerType: Into<YearFormat>,

The representation of the year.

  • Numeric: e.g., 2012
  • TwoDigit: e.g., 12

Cannot be combined with UseIntlDateTimeFormatOptions::date_style / UseIntlDateTimeFormatOptions::time_style.

Source

pub fn month<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
where OptionInnerType: Into<MonthFormat>,

The representation of the month.

  • Numeric: e.g., 3
  • TwoDigit: e.g., 03
  • Long: e.g., March
  • Short: e.g., Mar
  • Narrow: e.g., M. Two months may have the same narrow style for some locales (e.g. May’s narrow style is also M).

Cannot be combined with UseIntlDateTimeFormatOptions::date_style / UseIntlDateTimeFormatOptions::time_style.

Source

pub fn day<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
where OptionInnerType: Into<DayFormat>,

The representation of the day.

  • Numeric: e.g., 1
  • TwoDigit: e.g., 01

Cannot be combined with UseIntlDateTimeFormatOptions::date_style / UseIntlDateTimeFormatOptions::time_style.

Source

pub fn hour<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
where OptionInnerType: Into<TimeNumericFormat>,

The representation of the hour.

  • Numeric: e.g., 1
  • TwoDigit: e.g., 01

Cannot be combined with UseIntlDateTimeFormatOptions::date_style / UseIntlDateTimeFormatOptions::time_style.

Source

pub fn minute<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
where OptionInnerType: Into<TimeNumericFormat>,

The representation of the minute.

  • Numeric: e.g., 1
  • TwoDigit: e.g., 01

Cannot be combined with UseIntlDateTimeFormatOptions::date_style / UseIntlDateTimeFormatOptions::time_style.

Source

pub fn second<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
where OptionInnerType: Into<TimeNumericFormat>,

The representation of the second.

  • Numeric: e.g., 1
  • TwoDigit: e.g., 01

Cannot be combined with UseIntlDateTimeFormatOptions::date_style / UseIntlDateTimeFormatOptions::time_style.

Source

pub fn fractional_second_digits<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
where OptionInnerType: Into<u8>,

The number of digits used to represent fractions of a second (any additional digits are truncated). Possible values are from 1 to 3.

Source

pub fn time_zone_name<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
where 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).
Source

pub fn date_style<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
where 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.

Source

pub fn time_style<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
where 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.

Source§

impl UseIntlDateTimeFormatOptions

Source

pub fn locale(self, locale: &str) -> Self

A string with a BCP 47 language tag. Please refer to the MDN Docs for more info.

Trait Implementations§

Source§

impl Default for UseIntlDateTimeFormatOptions

Source§

fn default() -> UseIntlDateTimeFormatOptions

Returns the “default value” for a type. Read more
Source§

impl From<UseIntlDateTimeFormatOptions> for Object

Source§

fn from(options: UseIntlDateTimeFormatOptions) -> Self

Converts to this type from the input type.

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<E, T, Request, Encoding> FromReq<Patch<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request, Encoding> FromReq<Post<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request, Encoding> FromReq<Put<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, Encoding, Response, T> FromRes<Patch<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<E, Encoding, Response, T> FromRes<Post<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<E, Encoding, Response, T> FromRes<Put<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<El, T, Marker> IntoElementMaybeSignal<T, Marker> for El
where El: IntoElementMaybeSignalType<T, Marker>,

Source§

impl<T, Js> IntoElementMaybeSignalType<T, Element> for Js
where T: From<Js> + Clone,

Source§

impl<El, T, Marker> IntoElementsMaybeSignal<T, Marker> for El
where El: IntoElementsMaybeSignalType<T, Marker>,

Source§

impl<T, Js> IntoElementsMaybeSignalType<T, Element> for Js
where T: From<Js> + Clone,

Source§

impl<E, T, Encoding, Request> IntoReq<Patch<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Encoding, Request> IntoReq<Post<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Encoding, Request> IntoReq<Put<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, Response, Encoding, T> IntoRes<Patch<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<E, Response, Encoding, T> IntoRes<Post<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<E, Response, Encoding, T> IntoRes<Put<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<T> SerializableKey for T

Source§

fn ser_key(&self) -> String

Serializes the key to a unique string. Read more
Source§

impl<T> StorageAccess<T> for T

Source§

fn as_borrowed(&self) -> &T

Borrows the value.
Source§

fn into_taken(self) -> T

Takes the value.
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<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more