Struct neon::types::JsDate

source ·
#[repr(transparent)]
pub struct JsDate(_);
Available on crate feature napi-5 only.
Expand description

A JavaScript Date object

Implementations§

The smallest possible Date value, defined by ECMAScript. See https://www.ecma-international.org/ecma-262/5.1/#sec-15.7.3.3

The largest possible Date value, defined by ECMAScript. See https://www.ecma-international.org/ecma-262/5.1/#sec-15.7.3.2

Creates a new Date. It errors when value is outside the range of valid JavaScript Date values. When value is NaN, the operation will succeed but with an invalid Date

Creates a new Date with lossy conversion for out of bounds Date values. Out of bounds values will be treated as NaN

Gets the Date’s value. An invalid Date will return std::f64::NaN

Checks if the Date’s value is valid. A Date is valid if its value is between JsDate::MIN_VALUE and JsDate::MAX_VALUE or if it is NaN

Trait Implementations§

Formats the value using the given formatter. Read more
Gets a property from a JavaScript object that may be undefined and attempts to downcast the value if it existed. Read more
Gets a property from a JavaScript object as a JsValue. Read more
Gets a property from a JavaScript object and attempts to downcast as a specific type. Equivalent to calling obj.get_value(&mut cx)?.downcast_or_throw(&mut cx). Read more
Available on crate feature napi-6 only.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.