Struct RelativeTimeFormat
#[repr(transparent)]
pub struct RelativeTimeFormat { /* private fields */ }
The Intl.RelativeTimeFormat object is a constructor for objects
that enable language-sensitive relative time formatting.
Implementations
impl RelativeTimeFormat
fn format_to_parts(&self, value: f64, unit: &str) -> ArrayThe
Intl.RelativeTimeFormat.prototype.formatToParts()method returns an array of objects representing the relative time format in parts that can be used for custom locale-aware formatting.
impl RelativeTimeFormat
fn new(locales: &Array, options: &Object) -> RelativeTimeFormatThe
Intl.RelativeTimeFormatobject is a constructor for objects that enable language-sensitive relative time formatting.
impl RelativeTimeFormat
fn resolved_options(&self) -> ObjectThe
Intl.RelativeTimeFormat.prototype.resolvedOptions()method returns a new object with properties reflecting the locale and relative time formatting options computed during initialization of this RelativeTimeFormat object.
impl RelativeTimeFormat
fn format(&self, value: f64, unit: &str) -> JsStringThe
Intl.RelativeTimeFormat.prototype.formatmethod formats avalueandunitaccording to the locale and formatting options of this Intl.RelativeTimeFormat object.Throws a
RangeErrorif unit is invalid.
impl RelativeTimeFormat
fn supported_locales_of(locales: &Array, options: &Object) -> ArrayThe
Intl.RelativeTimeFormat.supportedLocalesOf()method returns an array containing those of the provided locales that are supported in date and time formatting without having to fall back to the runtime's default locale.
Trait Implementations
impl AsRef<JsValue> for RelativeTimeFormat
fn as_ref(&self) -> &JsValue
impl AsRef<Object> for RelativeTimeFormat
fn as_ref(&self) -> &Object
impl AsRef<RelativeTimeFormat> for RelativeTimeFormat
fn as_ref(&self) -> &RelativeTimeFormat
impl Clone for RelativeTimeFormat
fn clone(&self) -> Self
impl Debug for RelativeTimeFormat
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for RelativeTimeFormat
fn default() -> Self
impl Deref for RelativeTimeFormat
type Target = Object;fn deref(&self) -> &Object
impl ErasableGeneric for RelativeTimeFormat
type Repr = JsValue;
impl From<JsValue> for RelativeTimeFormat
fn from(obj: JsValue) -> Self
impl FromWasmAbi for RelativeTimeFormat
type Abi = <JsValue as FromWasmAbi>::Abi;unsafe fn from_abi(js: Self::Abi) -> Self
impl IntoJsGeneric for RelativeTimeFormat
where
RelativeTimeFormat: JsGeneric,
type JsCanon = RelativeTimeFormat;fn to_js(self) -> RelativeTimeFormat
impl IntoWasmAbi for RelativeTimeFormat
type Abi = <JsValue as IntoWasmAbi>::Abi;fn into_abi(self) -> Self::Abi
impl JsCast for RelativeTimeFormat
fn instanceof(val: &JsValue) -> boolfn unchecked_from_js(val: JsValue) -> Selffn unchecked_from_js_ref(val: &JsValue) -> &Self
impl LongRefFromWasmAbi for RelativeTimeFormat
type Abi = <JsValue as LongRefFromWasmAbi>::Abi;type Anchor = RelativeTimeFormat;unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
impl OptionFromWasmAbi for RelativeTimeFormat
fn is_none(abi: &Self::Abi) -> bool
impl OptionIntoWasmAbi for RelativeTimeFormat
fn none() -> Self::Abi
impl Promising for RelativeTimeFormat
type Resolution = RelativeTimeFormat;
impl RefFromWasmAbi for RelativeTimeFormat
type Abi = <JsValue as RefFromWasmAbi>::Abi;type Anchor = ManuallyDrop<RelativeTimeFormat>;unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
impl UpcastFrom<RelativeTimeFormat> for RelativeTimeFormat
impl WasmDescribe for RelativeTimeFormat
fn describe()