pub struct OwnedJsValue<'a> { /* private fields */ }Expand description
OwnedJsValue wraps a Javascript value owned by the QuickJs runtime.
Guarantees cleanup of resources by dropping the value from the runtime.
§Comparison to crate::JsValue:
JsValue is a native Rust value that can be converted to QuickJs native
types. OwnedJsValue, in contrast, owns the underlying QuickJs runtime
value directly.
Implementations§
Source§impl<'a> OwnedJsValue<'a>
impl<'a> OwnedJsValue<'a>
Sourcepub fn is_undefined(&self) -> bool
pub fn is_undefined(&self) -> bool
Check if this value is undefined.
Sourcepub fn is_exception(&self) -> bool
pub fn is_exception(&self) -> bool
Check if this value is a Javascript exception.
Sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Check if this value is a Javascript function.
Sourcepub fn is_compiled_function(&self) -> bool
pub fn is_compiled_function(&self) -> bool
Check if this value is a bytecode compiled function.
Trait Implementations§
Source§impl<'a> Clone for OwnedJsValue<'a>
impl<'a> Clone for OwnedJsValue<'a>
Source§impl<'a> Debug for OwnedJsValue<'a>
impl<'a> Debug for OwnedJsValue<'a>
Auto Trait Implementations§
impl<'a> Freeze for OwnedJsValue<'a>
impl<'a> !RefUnwindSafe for OwnedJsValue<'a>
impl<'a> !Send for OwnedJsValue<'a>
impl<'a> !Sync for OwnedJsValue<'a>
impl<'a> Unpin for OwnedJsValue<'a>
impl<'a> !UnwindSafe for OwnedJsValue<'a>
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