Object

Struct Object 

Source
pub struct Object;
Expand description

The global JavaScript object.

Implementations§

Source§

impl Object

Source

pub fn create( _: &JsValue, args: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.create( proto, [propertiesObject] )

Creates a new object from the provided prototype.

More information:

Source

pub fn get_own_property_descriptor( _: &JsValue, args: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.getOwnPropertyDescriptor( object, property )

Returns an object describing the configuration of a specific property on a given object.

More information:

Source

pub fn get_own_property_descriptors( _: &JsValue, args: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.getOwnPropertyDescriptors( object )

Returns all own property descriptors of a given object.

More information:

Source

pub fn is(_: &JsValue, args: &[JsValue], _: &mut Context) -> JsResult<JsValue>

Uses the SameValue algorithm to check equality of objects

Source

pub fn get_prototype_of( _: &JsValue, args: &[JsValue], ctx: &mut Context, ) -> JsResult<JsValue>

Get the prototype of an object.

Source

pub fn set_prototype_of( _: &JsValue, args: &[JsValue], ctx: &mut Context, ) -> JsResult<JsValue>

Set the prototype of an object.

More information

Source

pub fn is_prototype_of( this: &JsValue, args: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.prototype.isPrototypeOf( proto )

Check whether or not an object exists within another object’s prototype chain.

More information:

Source

pub fn define_property( _: &JsValue, args: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Define a property in an object

Source

pub fn define_properties( _: &JsValue, args: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.defineProperties( proto, [propertiesObject] )

Creates or update own properties to the object

More information:

Source

pub fn value_of( this: &JsValue, _: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.prototype.valueOf()

More information:

Source

pub fn to_string( this: &JsValue, _: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.prototype.toString()

This method returns a string representing the object.

More information:

Source

pub fn has_own_property( this: &JsValue, args: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.prototype.hasOwnPrototype( property )

The method returns a boolean indicating whether the object has the specified property as its own property (as opposed to inheriting it).

More information:

Source

pub fn property_is_enumerable( this: &JsValue, args: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.prototype.propertyIsEnumerable( property )

This method returns a Boolean indicating whether the specified property is enumerable and is the object’s own property.

More information:

Source

pub fn assign( _: &JsValue, args: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.assign( target, ...sources )

This method copies all enumerable own properties from one or more source objects to a target object. It returns the target object.

More information:

Source

pub fn keys( _: &JsValue, args: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.keys( target )

This method returns an array of a given object’s own enumerable property names, iterated in the same order that a normal loop would.

More information:

Source

pub fn values( _: &JsValue, args: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.values( target )

More information:

Source

pub fn entries( _: &JsValue, args: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.entries( target )

This method returns an array of a given object’s own enumerable string-keyed property [key, value] pairs. This is the same as iterating with a for…in loop, except that a for…in loop enumerates properties in the prototype chain as well).

More information:

Source

pub fn seal( _: &JsValue, args: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.seal( target )

More information:

Source

pub fn is_sealed( _: &JsValue, args: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.isSealed( target )

More information:

Source

pub fn freeze( _: &JsValue, args: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.freeze( target )

More information:

Source

pub fn is_frozen( _: &JsValue, args: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.isFrozen( target )

More information:

Source

pub fn prevent_extensions( _: &JsValue, args: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.preventExtensions( target )

More information:

Source

pub fn is_extensible( _: &JsValue, args: &[JsValue], context: &mut Context, ) -> JsResult<JsValue>

Object.isExtensible( target )

More information:

Trait Implementations§

Source§

impl Clone for Object

Source§

fn clone(&self) -> Object

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Object

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for Object

Auto Trait Implementations§

§

impl Freeze for Object

§

impl RefUnwindSafe for Object

§

impl Send for Object

§

impl Sync for Object

§

impl Unpin for Object

§

impl UnwindSafe for Object

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DynCopy for T
where T: Copy,