#[repr(transparent)]
pub struct JsNumber(_);
Expand description
The type of JavaScript
number
primitives.
let console: Handle<JsObject> = cx.global().get(&mut cx, "console")?;
let log: Handle<JsFunction> = console.get(&mut cx, "log")?;
let n = cx.number(17.0);
log.call_with(&cx).arg(n).exec(&mut cx)?;
Returns the value of this number as a Rust f64
.
Formats the value using the given formatter.
Read more
Available on crate feature sys
only.
Get a raw reference to the wrapped Node-API value.
Available on crate feature sys
only.
Creates a value from a raw Node-API value.
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.