Struct Duration

#[repr(transparent)]
pub struct Duration { /* private fields */ }

A duration object used as input to Intl.DurationFormat.format().

MDN documentation

Implementations

impl Duration

fn months(&self) -> Option<f64>

impl Duration

fn set_weeks(&self, value: f64)

impl Duration

fn hours(&self) -> Option<f64>

impl Duration

fn set_minutes(&self, value: f64)

impl Duration

fn milliseconds(&self) -> Option<f64>

impl Duration

fn set_microseconds(&self, value: f64)

impl Duration

fn new() -> Duration

impl Duration

fn years(&self) -> Option<f64>

impl Duration

fn set_months(&self, value: f64)

impl Duration

fn days(&self) -> Option<f64>

impl Duration

fn set_hours(&self, value: f64)

impl Duration

fn seconds(&self) -> Option<f64>

impl Duration

fn set_milliseconds(&self, value: f64)

impl Duration

fn nanoseconds(&self) -> Option<f64>

impl Duration

fn set_years(&self, value: f64)

impl Duration

fn weeks(&self) -> Option<f64>

impl Duration

fn set_days(&self, value: f64)

impl Duration

fn minutes(&self) -> Option<f64>

impl Duration

fn set_seconds(&self, value: f64)

impl Duration

fn microseconds(&self) -> Option<f64>

impl Duration

fn set_nanoseconds(&self, value: f64)

Trait Implementations

impl AsRef<Duration> for Duration

fn as_ref(&self) -> &Duration

impl AsRef<JsValue> for Duration

fn as_ref(&self) -> &JsValue

impl AsRef<Object> for Duration

fn as_ref(&self) -> &Object

impl Clone for Duration

fn clone(&self) -> Self

impl Debug for Duration

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

impl Default for Duration

fn default() -> Self

impl Deref for Duration

type Target = Object;
fn deref(&self) -> &Object

impl ErasableGeneric for Duration

type Repr = JsValue;

impl From<JsValue> for Duration

fn from(obj: JsValue) -> Self

impl FromWasmAbi for Duration

type Abi = <JsValue as FromWasmAbi>::Abi;
unsafe fn from_abi(js: Self::Abi) -> Self

impl IntoJsGeneric for Duration where Duration: JsGeneric,

type JsCanon = Duration;
fn to_js(self) -> Duration

impl IntoWasmAbi for Duration

type Abi = <JsValue as IntoWasmAbi>::Abi;
fn into_abi(self) -> Self::Abi

impl JsCast for Duration

fn instanceof(val: &JsValue) -> bool
fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self

impl LongRefFromWasmAbi for Duration

type Abi = <JsValue as LongRefFromWasmAbi>::Abi;
type Anchor = Duration;
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor

impl OptionFromWasmAbi for Duration

fn is_none(abi: &Self::Abi) -> bool

impl OptionIntoWasmAbi for Duration

fn none() -> Self::Abi

impl Promising for Duration

type Resolution = Duration;

impl RefFromWasmAbi for Duration

type Abi = <JsValue as RefFromWasmAbi>::Abi;
type Anchor = ManuallyDrop<Duration>;
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

impl UpcastFrom<Duration> for Duration

impl WasmDescribe for Duration

fn describe()

Auto Trait Implementations

impl Freeze for Duration

impl RefUnwindSafe for Duration

impl Send for Duration

impl Sync for Duration

impl Unpin for Duration

impl UnsafeUnpin for Duration

impl UnwindSafe for Duration

Blanket Implementations

impl<P, T> Receiver for Duration where P: Deref<Target = T> + ?Sized, T: ?Sized,

impl<S, T> Upcast<T> for Duration where T: UpcastFrom<S> + ?Sized, S: ?Sized,

impl<T> Any for Duration where T: 'static + ?Sized,

impl<T> Borrow<T> for Duration where T: ?Sized,

impl<T> BorrowMut<T> for Duration where T: ?Sized,

impl<T> CloneToUninit for Duration where T: Clone,

impl<T> From<T> for Duration

impl<T> JsGeneric for Duration where T: ErasableGeneric<Repr = JsValue> + UpcastFrom<T> + Upcast<JsValue> + JsCast + 'static,

impl<T> ReturnWasmAbi for Duration where T: IntoWasmAbi,

impl<T> ToOwned for Duration where T: Clone,

impl<T> TryFromJsValue for Duration where T: JsCast,

impl<T> VectorFromWasmAbi for Duration where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorIntoWasmAbi for Duration where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorRefIntoWasmAbi for Duration where &'a T: for<'a> Into<JsValue>,

impl<T, U> Into<U> for Duration where U: From<T>,

impl<T, U> TryFrom<U> for Duration where U: Into<T>,

impl<T, U> TryInto<U> for Duration where U: TryFrom<T>,