pub struct OwnedJsObject<'a> { /* private fields */ }Expand description
Wraps an object from the QuickJs runtime. Provides convenience property accessors.
Implementations§
Source§impl<'a> OwnedJsObject<'a>
impl<'a> OwnedJsObject<'a>
pub fn try_from_value(value: OwnedJsValue<'a>) -> Result<Self, ValueError>
pub fn into_value(self) -> OwnedJsValue<'a>
pub fn property( &self, name: &str, ) -> Result<Option<OwnedJsValue<'a>>, ExecutionError>
pub fn property_require( &self, name: &str, ) -> Result<OwnedJsValue<'a>, ExecutionError>
Sourcepub fn is_promise(&self) -> Result<bool, ExecutionError>
pub fn is_promise(&self) -> Result<bool, ExecutionError>
Determine if the object is a promise by checking the presence of a ‘then’ and a ‘catch’ property.
pub fn set_property( &self, name: &str, value: OwnedJsValue<'a>, ) -> Result<(), ExecutionError>
Trait Implementations§
Source§impl<'a> Clone for OwnedJsObject<'a>
impl<'a> Clone for OwnedJsObject<'a>
Source§fn clone(&self) -> OwnedJsObject<'a>
fn clone(&self) -> OwnedJsObject<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for OwnedJsObject<'a>
impl<'a> !RefUnwindSafe for OwnedJsObject<'a>
impl<'a> !Send for OwnedJsObject<'a>
impl<'a> !Sync for OwnedJsObject<'a>
impl<'a> Unpin for OwnedJsObject<'a>
impl<'a> !UnwindSafe for OwnedJsObject<'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