pub struct OwnedValueRef<'a> { /* private fields */ }Expand description
OwnedValueRef wraps a Javascript value from the quickjs runtime. It prevents leaks by ensuring that the inner value is deallocated on drop.
Implementations§
Source§impl<'a> OwnedValueRef<'a>
impl<'a> OwnedValueRef<'a>
pub fn new(context: &'a ContextWrapper, value: JSValue) -> Self
pub fn new_dup(context: &'a ContextWrapper, value: JSValue) -> Self
pub fn is_null(&self) -> bool
pub fn is_bool(&self) -> bool
pub fn is_exception(&self) -> bool
pub fn is_object(&self) -> bool
pub fn is_string(&self) -> bool
pub fn is_compiled_function(&self) -> bool
pub fn to_string(&self) -> Result<String, ExecutionError>
pub fn to_value(&self) -> Result<JsValue, ValueError>
pub fn to_bool(&self) -> Result<bool, ValueError>
Trait Implementations§
Source§impl<'a> Clone for OwnedValueRef<'a>
impl<'a> Clone for OwnedValueRef<'a>
Source§impl<'a> Debug for OwnedValueRef<'a>
impl<'a> Debug for OwnedValueRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for OwnedValueRef<'a>
impl<'a> !RefUnwindSafe for OwnedValueRef<'a>
impl<'a> !Send for OwnedValueRef<'a>
impl<'a> !Sync for OwnedValueRef<'a>
impl<'a> Unpin for OwnedValueRef<'a>
impl<'a> !UnwindSafe for OwnedValueRef<'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