logo
pub struct JsObject(_);
Expand description

Garbage collected Object.

Implementations

Create a new GcObject from a Object.

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 or if th prototype is not an object or undefined.

Checks if it 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 is a Map object.pub

Panics

Panics if the object is currently mutably borrowed.

Checks if it a String object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it a Function object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it a Symbol object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it an Error object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it a Boolean object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it a Number object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it a BigInt object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it a RegExp object.

Panics

Panics if the object is currently mutably borrowed.

Checks if it 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 GcObject 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

Converts this type into a shared reference of the (usually inferred) input type.
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
Converts to this type from the input type.
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

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.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. 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.