pub struct JSObject { /* private fields */ }
Expand description

Javascript objects. A JSObject always has a proto. It can have an optional ObjectValue (a primitive or array/function/closure). It has a dictionary of properties.

Implementations

Wrap the given native call into a Function.

Wrap the given closure into a Function.

Wrap the given vector into an Array.

Wrap the given bool into Boolean

It’s roughly Object.valueOf(self)

It self is an Array, give its underlying storage.

If self is an Array, give its underlying storage mutably.

If self is a String, get it primitive value

Tries to get JSValue of the own property name. This might call getters of the property.

Check own and all inherited properties for name and returns the first found value. ES5: [[Get]], None corresponds to undefined

If name is a number and self is an Array, just set the array elemnt to value. Otherwise: if the own property name does not exist, create it with Access::all() and set to Content::from(value). If the own property exists already, call .set() with its current access. This will fail to update non-writable properties. ES5: [[Put]] with strict error handing

Just like .set_property(), but updates even non-writable properties.

A shortcut for define_own_property(Access::NONE) and assigning the value.

A shortcut for defining a non-enumerable property and setting its value.

A shortcut for defining a non-configurable property and setting its value.

A shortcut for defining a non-writable property and setting its value.

Create a JSON from this JSObject.

Create a human-readable representation of contents of an Array or an Object.

Trait Implementations

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

Converts to this type from the input type.

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.

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.