Skip to main content

IntlWebHost

Struct IntlWebHost 

Source
pub struct IntlWebHost;
Available on crate feature datetime-intl only.
Expand description

The browser host with dates through Intl.DateTimeFormat and zone offsets from the browser’s zone data (datetime-intl).

Trait Implementations§

Source§

impl Clone for IntlWebHost

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for IntlWebHost

Source§

impl Debug for IntlWebHost

Source§

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

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

impl Default for IntlWebHost

Source§

fn default() -> Self

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

impl Host for IntlWebHost

Source§

fn nfc<'a>(&self, s: &'a str, buf: &'a mut String) -> &'a str

The NFC form of s, which failed the quick check (it has a code point at or above U+0300). buf is scratch the result may live in.
Source§

fn f64_to_text<'b>(&self, x: f64, buf: &'b mut [u8; 32]) -> Option<&'b str>

The shortest decimal text that round-trips the finite x, written into buf: any form number-literal accepts, with an optional + in the exponent (ryu’s 4.2, 1e21, 1.5e-7 and JavaScript’s String(x) both qualify). None if the host cannot produce it.
Source§

fn zone_offset(&self, zone: &str, epoch_ms: i64) -> Option<i32>

The UTC offset, in seconds east, of the IANA time zone zone at the instant epoch_ms (milliseconds since the epoch). None: the host has no zone data, or knows no such zone (the default) — a date/time function that must convert an instant to a named zone then reports Bad Option and a fallback value (datetime.md allows it; a wall time in the wrong zone would be worse).
Source§

fn format_date_time( &self, locale: &str, request: &DateTimeRequest<'_>, out: &mut dyn Sink, ) -> bool

datetime-intl: writes request formatted by the host’s date formatter (the browser’s Intl.DateTimeFormat) for locale, and returns true; false (the default) when the host has none.
Source§

fn numbers(&self) -> Option<&dyn NumberFormatter>

intl: the host’s number formatter (in the browser Intl.NumberFormat and Intl.PluralRules, when the engine has Intl.NumberFormat v3); None (the default) when it has none — the numeric functions of an intl client then show exact digits and report Unsupported Operation (plans/03-runtime.md §2.7).

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
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