[−][src]Struct boa::gc::GcObject
Garbage collected Object
.
Implementations
impl GcObject
[src]
pub fn new(object: Object) -> Self
[src]
Create a new GcObject
from a Object
.
pub fn borrow(&self) -> Ref<'_, Object>
[src]
Immutably borrows the Object
.
The borrow lasts until the returned Ref
exits scope.
Multiple immutable borrows can be taken out at the same time.
Panics
Panics if the object is currently mutably borrowed.
pub fn borrow_mut(&self) -> RefMut<'_, Object>
[src]
Mutably borrows the Object.
The borrow lasts until the returned RefMut
exits scope.
The object cannot be borrowed while this borrow is active.
Panics
Panics if the object is currently borrowed.
pub fn try_borrow(&self) -> StdResult<Ref<'_, Object>, BorrowError>
[src]
Immutably borrows the Object
, returning an error if the value is currently mutably borrowed.
The borrow lasts until the returned GcCellRef
exits scope.
Multiple immutable borrows can be taken out at the same time.
This is the non-panicking variant of borrow
.
pub fn try_borrow_mut(&self) -> StdResult<RefMut<'_, Object>, BorrowMutError>
[src]
Mutably borrows the object, returning an error if the value is currently borrowed.
The borrow lasts until the returned GcCellRefMut
exits scope.
The object be borrowed while this borrow is active.
This is the non-panicking variant of borrow_mut
.
pub fn equals(lhs: &Self, rhs: &Self) -> bool
[src]
Checks if the garbage collected memory is the same.
pub fn call(
&self,
this: &Value,
args: &[Value],
context: &mut Context
) -> Result<Value>
[src]
&self,
this: &Value,
args: &[Value],
context: &mut Context
) -> Result<Value>
pub fn construct(
&self,
args: &[Value],
new_target: Value,
context: &mut Context
) -> Result<Value>
[src]
&self,
args: &[Value],
new_target: Value,
context: &mut Context
) -> Result<Value>
Construct an instance of this object with the specified arguments.
Panics
Panics if the object is currently mutably borrowed.
pub fn to_property_descriptor(
&self,
context: &mut Context
) -> Result<PropertyDescriptor>
[src]
&self,
context: &mut Context
) -> Result<PropertyDescriptor>
Convert the object to a PropertyDescritptor
Panics
Panics if the object is currently mutably borrowed.
pub fn is<T>(&self) -> bool where
T: NativeObject,
[src]
T: NativeObject,
Reeturn true
if it is a native object and the native type is T
.
Panics
Panics if the object is currently mutably borrowed.
pub fn downcast_ref<T>(&self) -> Option<Ref<'_, T>> where
T: NativeObject,
[src]
T: NativeObject,
Downcast a reference to the object,
if the object is type native object type T
.
Panics
Panics if the object is currently mutably borrowed.
pub fn downcast_mut<T>(&mut self) -> Option<RefMut<'_, T>> where
T: NativeObject,
[src]
T: NativeObject,
Downcast a mutable reference to the object,
if the object is type native object type T
.
Panics
Panics if the object is currently borrowed.
pub fn prototype_instance(&self) -> Value
[src]
pub fn set_prototype_instance(&mut self, prototype: Value) -> bool
[src]
Set the prototype of the object.
Panics
Panics if the object is currently mutably borrowed or if th prototype is not an object or undefined.
pub fn is_array(&self) -> bool
[src]
pub fn is_array_iterator(&self) -> bool
[src]
pub fn is_map(&self) -> bool
[src]
pub fn is_string(&self) -> bool
[src]
pub fn is_function(&self) -> bool
[src]
pub fn is_symbol(&self) -> bool
[src]
pub fn is_error(&self) -> bool
[src]
pub fn is_boolean(&self) -> bool
[src]
pub fn is_number(&self) -> bool
[src]
pub fn is_bigint(&self) -> bool
[src]
pub fn is_regexp(&self) -> bool
[src]
pub fn is_ordinary(&self) -> bool
[src]
pub fn is_native_object(&self) -> bool
[src]
Returns true
if it holds an Rust type that implements NativeObject
.
Panics
Panics if the object is currently mutably borrowed.
pub fn get_method<K>(
&self,
context: &mut Context,
key: K
) -> Result<Option<GcObject>> where
K: Into<PropertyKey>,
[src]
&self,
context: &mut Context,
key: K
) -> Result<Option<GcObject>> where
K: Into<PropertyKey>,
Retrieves value of specific property, when the value of the property is expected to be a function.
More information:
pub fn has_own_property<K>(&self, key: K) -> bool where
K: Into<PropertyKey>,
[src]
K: Into<PropertyKey>,
impl GcObject
[src]
pub fn has_property(&self, key: &PropertyKey) -> bool
[src]
pub fn is_extensible(&self) -> bool
[src]
pub fn prevent_extensions(&mut self) -> bool
[src]
pub fn delete(&mut self, key: &PropertyKey) -> bool
[src]
Delete property.
pub fn get(
&self,
key: &PropertyKey,
receiver: Value,
context: &mut Context
) -> Result<Value>
[src]
&self,
key: &PropertyKey,
receiver: Value,
context: &mut Context
) -> Result<Value>
[[Get]]
https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-get-p-receiver
pub fn set(
&mut self,
key: PropertyKey,
val: Value,
receiver: Value,
context: &mut Context
) -> Result<bool>
[src]
&mut self,
key: PropertyKey,
val: Value,
receiver: Value,
context: &mut Context
) -> Result<bool>
[[Set]]
https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-set-p-v-receiver
pub fn define_own_property<K>(
&mut self,
key: K,
desc: PropertyDescriptor,
context: &mut Context
) -> Result<bool> where
K: Into<PropertyKey>,
[src]
&mut self,
key: K,
desc: PropertyDescriptor,
context: &mut Context
) -> Result<bool> where
K: Into<PropertyKey>,
pub fn ordinary_define_own_property<K>(
&mut self,
key: K,
desc: PropertyDescriptor
) -> bool where
K: Into<PropertyKey>,
[src]
&mut self,
key: K,
desc: PropertyDescriptor
) -> bool where
K: Into<PropertyKey>,
pub fn get_own_property(&self, key: &PropertyKey) -> Option<PropertyDescriptor>
[src]
The specification returns a Property Descriptor or Undefined.
These are 2 separate types and we can't do that here.
More information:
pub fn own_property_keys(&self) -> Vec<PropertyKey>
[src]
pub fn define_properties(
&mut self,
props: Value,
context: &mut Context
) -> Result<()>
[src]
&mut self,
props: Value,
context: &mut Context
) -> Result<()>
pub fn set_prototype_of(&mut self, val: Value) -> bool
[src]
Object.setPropertyOf(obj, prototype)
This method sets the prototype (i.e., the internal [[Prototype]]
property)
of a specified object to another object or null
.
More information:
pub fn get_prototype_of(&self) -> Value
[src]
pub fn is_callable(&self) -> bool
[src]
It determines if Object is a callable function with a [[Call]]
internal method.
More information:
pub fn is_constructable(&self) -> bool
[src]
It determines if Object is a function object with a [[Construct]]
internal method.
More information:
pub fn is_global(&self) -> bool
[src]
Returns true if the GcObject is the global for a Realm
Trait Implementations
impl AsRef<GcCell<Object>> for GcObject
[src]
impl Clone for GcObject
[src]
impl Debug for GcObject
[src]
impl Default for GcObject
[src]
impl Drop for GcObject
[src]
impl Finalize for GcObject
[src]
impl From<GcObject> for Value
[src]
impl Trace for GcObject
[src]
Auto Trait Implementations
impl !RefUnwindSafe for GcObject
[src]
impl !Send for GcObject
[src]
impl !Sync for GcObject
[src]
impl Unpin for GcObject
[src]
impl !UnwindSafe for GcObject
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> NativeObject for T where
T: Any + Debug + Trace,
[src]
T: Any + Debug + Trace,
pub fn as_any(&Self) -> &(dyn Any + 'static)
[src]
pub fn as_mut_any(&mut Self) -> &mut (dyn Any + 'static)
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,