Struct quickjspp::OwnedJsObject
source · pub struct OwnedJsObject { /* private fields */ }
Expand description
Wraps an object from the QuickJs runtime. Provides convenience property accessors.
Implementations§
source§impl OwnedJsObject
impl OwnedJsObject
pub fn try_from_value(value: OwnedJsValue) -> Result<Self, ValueError>
pub fn into_value(self) -> OwnedJsValue
pub fn properties_iter(&self) -> Result<OwnedJsPropertyIterator, ValueError>
pub fn property( &self, name: &str ) -> Result<Option<OwnedJsValue>, ExecutionError>
pub fn property_require( &self, name: &str ) -> Result<OwnedJsValue, 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 ) -> Result<(), ExecutionError>
Trait Implementations§
source§impl Clone for OwnedJsObject
impl Clone for OwnedJsObject
source§fn clone(&self) -> OwnedJsObject
fn clone(&self) -> OwnedJsObject
Returns a copy 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 moresource§impl Debug for OwnedJsObject
impl Debug for OwnedJsObject
source§impl PartialEq for OwnedJsObject
impl PartialEq for OwnedJsObject
source§fn eq(&self, other: &OwnedJsObject) -> bool
fn eq(&self, other: &OwnedJsObject) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for OwnedJsObject
Auto Trait Implementations§
impl RefUnwindSafe for OwnedJsObject
impl !Send for OwnedJsObject
impl !Sync for OwnedJsObject
impl Unpin for OwnedJsObject
impl UnwindSafe for OwnedJsObject
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