pub struct JSValue<V: JSValueImpl> { /* private fields */ }Implementations§
Source§impl<V> JSValue<V>where
V: JSTypeOf,
impl<V> JSValue<V>where
V: JSTypeOf,
pub fn take_is_object(self) -> Option<Self>
pub fn is_object(&self) -> bool
pub fn take_is_array(self) -> Option<Self>
pub fn is_array(&self) -> bool
pub fn take_is_array_buffer(self) -> Option<Self>
pub fn is_array_buffer(&self) -> bool
pub fn take_is_function(self) -> Option<Self>
pub fn is_function(&self) -> bool
pub fn take_is_constructor(self) -> Option<Self>
pub fn is_constructor(&self) -> bool
pub fn take_is_promise(self) -> Option<Self>
pub fn is_promise(&self) -> bool
pub fn take_is_error(self) -> Option<Self>
pub fn is_error(&self) -> bool
pub fn take_is_exception(self) -> Option<Self>
pub fn is_exception(&self) -> bool
pub fn take_is_undefined(self) -> Option<Self>
pub fn is_undefined(&self) -> bool
pub fn take_is_null(self) -> Option<Self>
pub fn is_null(&self) -> bool
pub fn take_is_boolean(self) -> Option<Self>
pub fn is_boolean(&self) -> bool
pub fn take_is_number(self) -> Option<Self>
pub fn is_number(&self) -> bool
pub fn take_is_bigint(self) -> Option<Self>
pub fn is_bigint(&self) -> bool
pub fn take_is_string(self) -> Option<Self>
pub fn is_string(&self) -> bool
pub fn take_is_symbol(self) -> Option<Self>
pub fn is_symbol(&self) -> bool
pub fn take_is_date(self) -> Option<Self>
pub fn is_date(&self) -> bool
pub fn take_is_proxy(self) -> Option<Self>
pub fn is_proxy(&self) -> bool
Source§impl<V> JSValue<V>where
V: JSValueImpl,
impl<V> JSValue<V>where
V: JSValueImpl,
pub fn from_raw(_ctx: &JSContext<V::Context>, value: V) -> Self
pub fn as_value(&self) -> &V
pub fn into_value(self) -> V
Sourcepub fn from_rust<T>(ctx: &JSContext<V::Context>, val: T) -> Selfwhere
T: IntoJSValue<V>,
pub fn from_rust<T>(ctx: &JSContext<V::Context>, val: T) -> Selfwhere
T: IntoJSValue<V>,
Converts a Rust value into a JSValue.
Sourcepub fn to_rust<T>(self) -> JSResult<T>where
T: FromJSValue<V>,
pub fn to_rust<T>(self) -> JSResult<T>where
T: FromJSValue<V>,
Converts a JavaScript value into a Rust value.
Source§impl<V> JSValue<V>where
V: JSValueImpl + JSTypeOf,
impl<V> JSValue<V>where
V: JSValueImpl + JSTypeOf,
Sourcepub fn into_object(self) -> Option<JSObject<V>>
pub fn into_object(self) -> Option<JSObject<V>>
Convert JSValue into JSObject if it is an object
§Returns
Some(JSObject)if the value is an objectNoneif the value is not an object
Trait Implementations§
Source§impl<V: JSValueImpl> Clone for JSValue<V>
impl<V: JSValueImpl> Clone for JSValue<V>
Source§impl<V> FromJSValue<V> for JSValue<V>where
V: JSValueImpl,
impl<V> FromJSValue<V> for JSValue<V>where
V: JSValueImpl,
Source§impl<V: JSValueImpl> Hash for JSValue<V>
impl<V: JSValueImpl> Hash for JSValue<V>
Source§impl<V> IntoJSValue<V> for JSValue<V>where
V: JSValueImpl,
impl<V> IntoJSValue<V> for JSValue<V>where
V: JSValueImpl,
Source§impl<V: JSValueImpl> PartialEq for JSValue<V>
impl<V: JSValueImpl> PartialEq for JSValue<V>
impl<V: JSValueImpl> Eq for JSValue<V>
impl<V: JSValueImpl> JSParameterType for JSValue<V>
Auto Trait Implementations§
impl<V> Freeze for JSValue<V>where
V: Freeze,
impl<V> RefUnwindSafe for JSValue<V>where
V: RefUnwindSafe,
impl<V> Send for JSValue<V>where
V: Send,
impl<V> Sync for JSValue<V>where
V: Sync,
impl<V> Unpin for JSValue<V>where
V: Unpin,
impl<V> UnsafeUnpin for JSValue<V>where
V: UnsafeUnpin,
impl<V> UnwindSafe for JSValue<V>where
V: UnwindSafe,
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