pub enum JsValue {
Undefined,
Null,
Boolean(bool),
Number(JsNumber),
String(String),
Object(ObjectId),
Function(FunctionId),
}Expand description
JavaScript value (no floating point)
Variants§
Implementations§
Source§impl JsValue
impl JsValue
Sourcepub fn to_boolean(&self) -> bool
pub fn to_boolean(&self) -> bool
Convert to boolean (JavaScript truthiness)
Sourcepub fn to_js_string(&self) -> String
pub fn to_js_string(&self) -> String
Convert to string
Sourcepub fn abstract_eq(&self, other: &Self) -> bool
pub fn abstract_eq(&self, other: &Self) -> bool
Abstract equality (==), simplified
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JsValue
impl RefUnwindSafe for JsValue
impl Send for JsValue
impl Sync for JsValue
impl Unpin for JsValue
impl UnwindSafe for JsValue
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)