Struct boa::object::JsObject [−][src]
pub struct JsObject(_);
Expand description
Garbage collected Object
.
Implementations
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.
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.
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
.
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
.
Checks if the garbage collected memory is the same.
Return true
if it is a native object and the native type is T
.
Panics
Panics if the object is currently mutably borrowed.
Downcast a reference to the object,
if the object is type native object type T
.
Panics
Panics if the object is currently mutably borrowed.
Downcast a mutable reference to the object,
if the object is type native object type T
.
Panics
Panics if the object is currently borrowed.
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.
Returns true
if it holds an Rust type that implements NativeObject
.
Panics
Panics if the object is currently mutably borrowed.
pub fn copy_data_properties<K>(
&mut self,
source: &JsValue,
excluded_keys: Vec<K>,
context: &mut Context
) -> JsResult<()> where
K: Into<PropertyKey>,
pub fn copy_data_properties<K>(
&mut self,
source: &JsValue,
excluded_keys: Vec<K>,
context: &mut Context
) -> JsResult<()> where
K: Into<PropertyKey>,
pub fn insert_property<K, P>(
&self,
key: K,
property: P
) -> Option<PropertyDescriptor> where
K: Into<PropertyKey>,
P: Into<PropertyDescriptor>,
pub fn insert_property<K, P>(
&self,
key: K,
property: P
) -> Option<PropertyDescriptor> where
K: Into<PropertyKey>,
P: Into<PropertyDescriptor>,
Inserts a field in the object properties
without checking if it’s writable.
If a field was already in the object with the same name that a Some
is returned
with that field, otherwise None is returned.
It determines if Object is a callable function with a [[Call]]
internal method.
More information:
It determines if Object is a function object with a [[Construct]]
internal method.
More information:
pub fn create_data_property<K, V>(
&self,
key: K,
value: V,
context: &mut Context
) -> JsResult<bool> where
K: Into<PropertyKey>,
V: Into<JsValue>,
pub fn create_data_property<K, V>(
&self,
key: K,
value: V,
context: &mut Context
) -> JsResult<bool> where
K: Into<PropertyKey>,
V: Into<JsValue>,
pub fn create_data_property_or_throw<K, V>(
&self,
key: K,
value: V,
context: &mut Context
) -> JsResult<bool> where
K: Into<PropertyKey>,
V: Into<JsValue>,
pub fn create_data_property_or_throw<K, V>(
&self,
key: K,
value: V,
context: &mut Context
) -> JsResult<bool> where
K: Into<PropertyKey>,
V: Into<JsValue>,
pub fn define_property_or_throw<K, P>(
&self,
key: K,
desc: P,
context: &mut Context
) -> JsResult<bool> where
K: Into<PropertyKey>,
P: Into<PropertyDescriptor>,
pub fn define_property_or_throw<K, P>(
&self,
key: K,
desc: P,
context: &mut Context
) -> JsResult<bool> where
K: Into<PropertyKey>,
P: Into<PropertyDescriptor>,
pub fn delete_property_or_throw<K>(
&self,
key: K,
context: &mut Context
) -> JsResult<bool> where
K: Into<PropertyKey>,
pub fn delete_property_or_throw<K>(
&self,
key: K,
context: &mut Context
) -> JsResult<bool> where
K: Into<PropertyKey>,
Defines the property or throws a TypeError
if the operation fails.
More information:
pub fn has_property<K>(&self, key: K, context: &mut Context) -> JsResult<bool> where
K: Into<PropertyKey>,
pub fn has_property<K>(&self, key: K, context: &mut Context) -> JsResult<bool> where
K: Into<PropertyKey>,
pub fn has_own_property<K>(
&self,
key: K,
context: &mut Context
) -> JsResult<bool> where
K: Into<PropertyKey>,
pub fn has_own_property<K>(
&self,
key: K,
context: &mut Context
) -> JsResult<bool> where
K: Into<PropertyKey>,
Construct an instance of this object with the specified arguments.
Panics
Panics if the object is currently mutably borrowed.
pub fn set_integrity_level(
&self,
level: IntegrityLevel,
context: &mut Context
) -> JsResult<bool>
pub fn set_integrity_level(
&self,
level: IntegrityLevel,
context: &mut Context
) -> JsResult<bool>
pub fn test_integrity_level(
&self,
level: IntegrityLevel,
context: &mut Context
) -> JsResult<bool>
pub fn test_integrity_level(
&self,
level: IntegrityLevel,
context: &mut Context
) -> JsResult<bool>
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for JsObject
impl !UnwindSafe for JsObject
Blanket Implementations
Mutably borrows from an owned value. Read more