[][src]Struct rusty_v8::Object

#[repr(C)]
pub struct Object(_);

A JavaScript object (ECMA-262, 4.3.3)

Methods

impl Object[src]

pub fn new<'sc>(
    scope: &mut impl ToLocal<'sc>,
    prototype_or_null: Local<'sc, Value>,
    names: Vec<Local<'sc, Name>>,
    values: Vec<Local<'sc, Value>>,
    length: usize
) -> Local<'sc, Object>
[src]

Creates a JavaScript object with the given properties, and a the given prototype_or_null (which can be any JavaScript value, and if it's null, the newly created object won't have a prototype at all). This is similar to Object.create(). All properties will be created as enumerable, configurable and writable properties.

pub fn set(
    &self,
    context: Local<Context>,
    key: Local<Value>,
    value: Local<Value>
) -> MaybeBool
[src]

Set only return Just(true) or Empty(), so if it should never fail, use result.Check().

pub fn create_data_property(
    &self,
    context: Local<Context>,
    key: Local<Name>,
    value: Local<Value>
) -> MaybeBool
[src]

Implements CreateDataProperty (ECMA-262, 7.3.4).

Defines a configurable, writable, enumerable property with the given value on the object unless the property already exists and is not configurable or the object is not extensible.

Returns true on success.

pub fn get<'a>(
    &self,
    scope: &mut impl ToLocal<'a>,
    context: Local<Context>,
    key: Local<Value>
) -> Option<Local<'a, Value>>
[src]

pub fn get_isolate(&mut self) -> &Isolate[src]

Return the isolate to which the Object belongs to.

Methods from Deref<Target = Value>

pub fn is_undefined(&self) -> bool[src]

Returns true if this value is the undefined value. See ECMA-262 4.3.10.

pub fn is_null(&self) -> bool[src]

Returns true if this value is the null value. See ECMA-262 4.3.11.

pub fn is_null_or_undefined(&self) -> bool[src]

Returns true if this value is either the null or the undefined value. See ECMA-262 4.3.11. and 4.3.12

pub fn is_string(&self) -> bool[src]

Returns true if this value is an instance of the String type. See ECMA-262 8.4.

pub fn is_array(&self) -> bool[src]

Returns true if this value is an array. Note that it will return false for an Proxy for an array.

pub fn is_function(&self) -> bool[src]

Returns true if this value is a function.

pub fn is_object(&self) -> bool[src]

Returns true if this value is an object.

pub fn is_number(&self) -> bool[src]

Returns true if this value is a number.

pub fn strict_equals<'sc>(&self, that: Local<'sc, Value>) -> bool[src]

pub fn same_value<'sc>(&self, that: Local<'sc, Value>) -> bool[src]

Trait Implementations

impl Deref for Object[src]

type Target = Value

The resulting type after dereferencing.

Auto Trait Implementations

impl RefUnwindSafe for Object

impl Send for Object

impl Sync for Object

impl Unpin for Object

impl UnwindSafe for Object

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.