Struct DurationFormat
#[repr(transparent)]
pub struct DurationFormat { /* private fields */ }
The Intl.DurationFormat object enables language-sensitive duration formatting.
Implementations
impl DurationFormat
fn format(&self, duration: &Duration) -> JsStringFormats a duration according to the locale and formatting options.
impl DurationFormat
fn supported_locales_of(locales: &[JsString], options: &LocaleMatcherOptions) -> Result<Array<JsString>, JsValue>Returns an array of supported locales.
Throws a
RangeErrorif locales contain invalid values.
impl DurationFormat
fn format_to_parts(&self, duration: &Duration) -> Array<DurationFormatPart>Returns an array of objects representing the formatted duration in parts.
impl DurationFormat
fn new(locales: &[JsString], options: &DurationFormatOptions) -> Result<DurationFormat, JsValue>Creates a new
Intl.DurationFormatobject.Throws a
RangeErrorif locales or options contain invalid values.
impl DurationFormat
fn resolved_options(&self) -> ResolvedDurationFormatOptionsReturns an object with properties reflecting the options used.
Trait Implementations
impl AsRef<DurationFormat> for DurationFormat
fn as_ref(&self) -> &DurationFormat
impl AsRef<JsValue> for DurationFormat
fn as_ref(&self) -> &JsValue
impl AsRef<Object> for DurationFormat
fn as_ref(&self) -> &Object
impl Clone for DurationFormat
fn clone(&self) -> Self
impl Debug for DurationFormat
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for DurationFormat
fn default() -> Self
impl Deref for DurationFormat
type Target = Object;fn deref(&self) -> &Object
impl ErasableGeneric for DurationFormat
type Repr = JsValue;
impl From<JsValue> for DurationFormat
fn from(obj: JsValue) -> Self
impl FromWasmAbi for DurationFormat
type Abi = <JsValue as FromWasmAbi>::Abi;unsafe fn from_abi(js: Self::Abi) -> Self
impl IntoJsGeneric for DurationFormat
where
DurationFormat: JsGeneric,
type JsCanon = DurationFormat;fn to_js(self) -> DurationFormat
impl IntoWasmAbi for DurationFormat
type Abi = <JsValue as IntoWasmAbi>::Abi;fn into_abi(self) -> Self::Abi
impl JsCast for DurationFormat
fn instanceof(val: &JsValue) -> boolfn unchecked_from_js(val: JsValue) -> Selffn unchecked_from_js_ref(val: &JsValue) -> &Self
impl LongRefFromWasmAbi for DurationFormat
type Abi = <JsValue as LongRefFromWasmAbi>::Abi;type Anchor = DurationFormat;unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
impl OptionFromWasmAbi for DurationFormat
fn is_none(abi: &Self::Abi) -> bool
impl OptionIntoWasmAbi for DurationFormat
fn none() -> Self::Abi
impl Promising for DurationFormat
type Resolution = DurationFormat;
impl RefFromWasmAbi for DurationFormat
type Abi = <JsValue as RefFromWasmAbi>::Abi;type Anchor = ManuallyDrop<DurationFormat>;unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
impl UpcastFrom<DurationFormat> for DurationFormat
impl WasmDescribe for DurationFormat
fn describe()