Struct boa_engine::object::Object
source · pub struct Object<T: ?Sized> { /* private fields */ }
Expand description
The internal representation of a JavaScript object.
Implementations§
source§impl<T: ?Sized> Object<T>
impl<T: ?Sized> Object<T>
sourcepub fn prototype(&self) -> JsPrototype
pub fn prototype(&self) -> JsPrototype
Gets the prototype instance of this object.
sourcepub fn set_prototype<O: Into<JsPrototype>>(&mut self, prototype: O) -> bool
pub fn set_prototype<O: Into<JsPrototype>>(&mut self, prototype: O) -> bool
Sets the prototype instance of the object.
sourcepub const fn properties(&self) -> &PropertyMap
pub const fn properties(&self) -> &PropertyMap
Returns the properties of the object.
source§impl Object<dyn NativeObject>
impl Object<dyn NativeObject>
sourcepub fn is<T: NativeObject>(&self) -> bool
pub fn is<T: NativeObject>(&self) -> bool
Return true
if it is a native object and the native type is T
.
sourcepub fn downcast_ref<T: NativeObject>(&self) -> Option<&T>
pub fn downcast_ref<T: NativeObject>(&self) -> Option<&T>
Downcast a reference to the object,
if the object is type native object type T
.
sourcepub fn downcast_mut<T: NativeObject>(&mut self) -> Option<&mut T>
pub fn downcast_mut<T: NativeObject>(&mut self) -> Option<&mut T>
Downcast a mutable reference to the object,
if the object is type native object type T
.
sourcepub fn is_typed_uint8_array(&self) -> bool
pub fn is_typed_uint8_array(&self) -> bool
Checks if it a Uint8Array
object.
sourcepub fn is_typed_int8_array(&self) -> bool
pub fn is_typed_int8_array(&self) -> bool
Checks if it a Int8Array
object.
sourcepub fn is_typed_uint16_array(&self) -> bool
pub fn is_typed_uint16_array(&self) -> bool
Checks if it a Uint16Array
object.
sourcepub fn is_typed_int16_array(&self) -> bool
pub fn is_typed_int16_array(&self) -> bool
Checks if it a Int16Array
object.
sourcepub fn is_typed_uint32_array(&self) -> bool
pub fn is_typed_uint32_array(&self) -> bool
Checks if it a Uint32Array
object.
sourcepub fn is_typed_int32_array(&self) -> bool
pub fn is_typed_int32_array(&self) -> bool
Checks if it a Int32Array
object.
sourcepub fn is_typed_float32_array(&self) -> bool
pub fn is_typed_float32_array(&self) -> bool
Checks if it a Float32Array
object.
sourcepub fn is_typed_float64_array(&self) -> bool
pub fn is_typed_float64_array(&self) -> bool
Checks if it a Float64Array
object.
Trait Implementations§
source§impl<T> Trace for Object<T>
impl<T> Trace for Object<T>
source§unsafe fn trace_non_roots(&self)
unsafe fn trace_non_roots(&self)
Trace handles located in GC heap, and mark them as non root. Read more
source§fn run_finalizer(&self)
fn run_finalizer(&self)
Runs
Finalize::finalize
on this object and all
contained subobjects.Auto Trait Implementations§
impl<T> !RefUnwindSafe for Object<T>
impl<T> !Send for Object<T>
impl<T> !Sync for Object<T>
impl<T: ?Sized> Unpin for Object<T>where
T: Unpin,
impl<T> !UnwindSafe for Object<T>
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
source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.