logo
pub struct JsObject { /* private fields */ }
Expand description

Garbage collected Object.

Implementations

Create a new empty JsObject, with prototype set to JsValue::Null and data set to ObjectData::ordinary

The more general form of OrdinaryObjectCreate and MakeBasicObject.

Create a JsObject and automatically set its internal methods and internal slots from the data provided.

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.

Get the prototype of the object.

Panics

Panics if the object is currently mutably borrowed.

Set the prototype of the object.

Panics

Panics if the object is currently mutably borrowed

Checks if it’s an Array object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it is an ArrayIterator object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it’s an ArrayBuffer object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it is a Map object.pub

Panics

Panics if the object is currently mutably borrowed.

Checks if it’s a String object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it’s a Function object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it’s a Generator object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it’s a Symbol object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it’s an Error object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it’s a Boolean object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it’s a Number object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it’s a BigInt object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it’s a RegExp object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it’s a TypedArray object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it’s an ordinary object.

Panics

Panics if the object is currently mutably borrowed.

Returns true if it holds an Rust type that implements NativeObject.

Panics

Panics if the object is currently mutably borrowed.

7.3.25 CopyDataProperties ( target, source, excludedItems )

More information:

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:

Returns true if the JsObject is the global for a Realm

Cehck if object is extensible.

More information:

Get property from object or throw.

More information:

set property of object or throw if bool flag is passed.

More information:

Create data property

More information:

Create data property or throw

More information:

Define property or throw.

More information:

Defines the property or throws a TypeError if the operation fails.

More information:

Check if object has property.

More information:

Check if object has an own property.

More information:

Call this object.

Panics

Panics if the object is currently mutably borrowed.

Construct an instance of this object with the specified arguments.

Panics

Panics if the object is currently mutably borrowed.

Make the object sealed or frozen.

More information:

Check if the object is sealed or frozen.

More information:

Trait Implementations

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Executes the destructor for this type. Read more

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Marks all contained Gcs.

Increments the root-count of all contained Gcs.

Decrements the root-count of all contained Gcs.

Runs Finalize::finalize() on this object and all contained subobjects Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into T using Into<T>. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert the Rust type which implements NativeObject to a &dyn Any.

Convert the Rust type which implements NativeObject to a &mut dyn Any.

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Attempts to convert self into T using TryInto<T>. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.