pub struct JsNumber(/* private fields */);
Expand description
The type of JavaScript number primitives.
§Example
// Extract the console.log function:
let console: Handle<JsObject> = cx.global("console")?;
let log: Handle<JsFunction> = console.get(&mut cx, "log")?;
// Create a number:
let n = cx.number(17.0);
// Call console.log(n):
log.call_with(&cx).arg(n).exec(&mut cx)?;
Implementations§
Trait Implementations§
source§impl Value for JsNumber
impl Value for JsNumber
Auto Trait Implementations§
impl RefUnwindSafe for JsNumber
impl !Send for JsNumber
impl !Sync for JsNumber
impl Unpin for JsNumber
impl UnwindSafe for JsNumber
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more