pub struct JSValue { /* private fields */ }Expand description
Represents a JavaScript value that can hold any JS type (undefined, null, boolean, number, string, object, etc.)
Implementations§
Source§impl JSValue
impl JSValue
pub unsafe fn from_raw(ptr: *mut JSIValue) -> Self
pub fn is_undefined(&self) -> bool
pub fn is_null(&self) -> bool
pub fn is_bool(&self) -> bool
pub fn is_number(&self) -> bool
pub fn is_string(&self) -> bool
pub fn is_object(&self) -> bool
pub fn is_bigint(&self) -> bool
pub fn as_function(&self, runtime: &mut JSRuntime) -> Option<JSFunction>
pub fn as_bool(&self) -> bool
pub fn as_number(&self) -> f64
pub fn as_string(&self, runtime: &mut JSRuntime) -> Option<JSString>
pub fn as_bigint(&self, runtime: &mut JSRuntime) -> Option<JSBigInt>
Auto Trait Implementations§
impl !Send for JSValue
impl !Sync for JSValue
impl Forget for JSValue
impl Freeze for JSValue
impl RefUnwindSafe for JSValue
impl Unpin for JSValue
impl UnsafeUnpin for JSValue
impl UnwindSafe for JSValue
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