[][src]Struct rusty_v8::Object

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

A JavaScript object (ECMA-262, 4.3.3)

Implementations

impl Object[src]

pub fn new<'s>(scope: &mut HandleScope<'s>) -> Local<'s, Object>[src]

Creates an empty object.

pub fn with_prototype_and_properties<'s>(
    scope: &mut HandleScope<'s>,
    prototype_or_null: Local<'s, Value>,
    names: &[Local<'_, Name>],
    values: &[Local<'_, Value>]
) -> Local<'s, Object>
[src]

Creates a JavaScript object with the given properties, and 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,
    scope: &mut HandleScope<'_>,
    key: Local<'_, Value>,
    value: Local<'_, Value>
) -> Option<bool>
[src]

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

pub fn set_index(
    &self,
    scope: &mut HandleScope<'_>,
    index: u32,
    value: Local<'_, Value>
) -> Option<bool>
[src]

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

pub fn set_prototype(
    &self,
    scope: &mut HandleScope<'_>,
    prototype: Local<'_, Value>
) -> Option<bool>
[src]

Set the prototype object. This does not skip objects marked to be skipped by proto and it does not consult the security handler.

pub fn create_data_property(
    &self,
    scope: &mut HandleScope<'_>,
    key: Local<'_, Name>,
    value: Local<'_, Value>
) -> Option<bool>
[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 define_own_property(
    &self,
    scope: &mut HandleScope<'_>,
    key: Local<'_, Name>,
    value: Local<'_, Value>,
    attr: PropertyAttribute
) -> Option<bool>
[src]

Implements DefineOwnProperty.

In general, CreateDataProperty will be faster, however, does not allow for specifying attributes.

Returns true on success.

pub fn get<'s>(
    &self,
    scope: &mut HandleScope<'s>,
    key: Local<'_, Value>
) -> Option<Local<'s, Value>>
[src]

pub fn get_index<'s>(
    &self,
    scope: &mut HandleScope<'s>,
    index: u32
) -> Option<Local<'s, Value>>
[src]

pub fn get_prototype<'s>(
    &self,
    scope: &mut HandleScope<'s>
) -> Option<Local<'s, Value>>
[src]

Get the prototype object. This does not skip objects marked to be skipped by proto and it does not consult the security handler.

pub fn set_accessor(
    &self,
    scope: &mut HandleScope<'_>,
    name: Local<'_, Name>,
    getter: impl for<'s> MapFnTo<AccessorNameGetterCallback<'s>>
) -> Option<bool>
[src]

Note: SideEffectType affects the getter only, not the setter.

pub fn set_accessor_with_setter(
    &self,
    scope: &mut HandleScope<'_>,
    name: Local<'_, Name>,
    getter: impl for<'s> MapFnTo<AccessorNameGetterCallback<'s>>,
    setter: impl for<'s> MapFnTo<AccessorNameSetterCallback<'s>>
) -> Option<bool>
[src]

pub fn creation_context<'s>(
    &self,
    scope: &mut HandleScope<'s>
) -> Local<'s, Context>
[src]

Returns the context in which the object was created.

pub fn get_own_property_names<'s>(
    &self,
    scope: &mut HandleScope<'s>
) -> Option<Local<'s, Array>>
[src]

This function has the same functionality as GetPropertyNames but the returned array doesn't contain the names of properties from prototype objects.

pub fn get_property_names<'s>(
    &self,
    scope: &mut HandleScope<'s>
) -> Option<Local<'s, Array>>
[src]

Returns an array containing the names of the filtered properties of this object, including properties from prototype objects. The array returned by this method contains the same values as would be enumerated by a for-in statement over this object.

pub fn has<'s>(
    &self,
    scope: &mut HandleScope<'s>,
    key: Local<'_, Value>
) -> Option<bool>
[src]

pub fn has_index<'s>(
    &self,
    scope: &mut HandleScope<'s>,
    index: u32
) -> Option<bool>
[src]

pub fn delete<'s>(
    &self,
    scope: &mut HandleScope<'s>,
    key: Local<'_, Value>
) -> Option<bool>
[src]

pub fn delete_index<'s>(
    &self,
    scope: &mut HandleScope<'s>,
    index: u32
) -> Option<bool>
[src]

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_true(&self) -> bool[src]

Returns true if this value is true. This is not the same as BooleanValue(). The latter performs a conversion to boolean, i.e. the result of Boolean(value) in JS, whereas this checks value === true.

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

Returns true if this value is false. This is not the same as !BooleanValue(). The latter performs a conversion to boolean, i.e. the result of !Boolean(value) in JS, whereas this checks value === false.

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

Returns true if this value is a symbol or a string. This is equivalent to typeof value === 'string' || typeof value === 'symbol' in JS.

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_symbol(&self) -> bool[src]

Returns true if this value is a symbol. This is equivalent to typeof value === 'symbol' in JS.

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

Returns true if this value is a function.

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_object(&self) -> bool[src]

Returns true if this value is an object.

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

Returns true if this value is a bigint. This is equivalent to typeof value === 'bigint' in JS.

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

Returns true if this value is boolean. This is equivalent to typeof value === 'boolean' in JS.

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

Returns true if this value is a number.

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

Returns true if this value is an External object.

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

Returns true if this value is a 32-bit signed integer.

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

Returns true if this value is a 32-bit unsigned integer.

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

Returns true if this value is a Date.

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

Returns true if this value is an Arguments object.

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

Returns true if this value is a BigInt object.

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

Returns true if this value is a Boolean object.

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

Returns true if this value is a Number object.

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

Returns true if this value is a String object.

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

Returns true if this value is a Symbol object.

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

Returns true if this value is a NativeError.

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

Returns true if this value is a RegExp.

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

Returns true if this value is an async function.

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

Returns true if this value is a Generator function.

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

Returns true if this value is a Promise.

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

Returns true if this value is a Map.

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

Returns true if this value is a Set.

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

Returns true if this value is a Map Iterator.

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

Returns true if this value is a Set Iterator.

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

Returns true if this value is a WeakMap.

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

Returns true if this value is a WeakSet.

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

Returns true if this value is an ArrayBuffer.

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

Returns true if this value is an ArrayBufferView.

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

Returns true if this value is one of TypedArrays.

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

Returns true if this value is an Uint8Array.

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

Returns true if this value is an Uint8ClampedArray.

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

Returns true if this value is an Int8Array.

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

Returns true if this value is an Uint16Array.

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

Returns true if this value is an Int16Array.

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

Returns true if this value is an Uint32Array.

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

Returns true if this value is an Int32Array.

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

Returns true if this value is a Float32Array.

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

Returns true if this value is a Float64Array.

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

Returns true if this value is a BigInt64Array.

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

Returns true if this value is a BigUint64Array.

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

Returns true if this value is a DataView.

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

Returns true if this value is a SharedArrayBuffer. This is an experimental feature.

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

Returns true if this value is a JavaScript Proxy.

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

Returns true if this value is a WasmModuleObject.

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

Returns true if the value is a Module Namespace Object.

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

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

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

Implements the the abstract operation SameValueZero, which is defined in ECMA-262 6th edition § 7.2.10 (http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero).

This operation is used to compare values for the purpose of insertion into a Set, or determining whether Map keys are equivalent. Its semantics are almost the same as strict_equals() and same_value(), with the following important distinctions:

  • It considers NaN equal to NaN (unlike strict_equals()).
  • It considers -0 equal to 0 (unlike same_value()).

pub fn to_big_int<'s>(
    &self,
    scope: &mut HandleScope<'s>
) -> Option<Local<'s, BigInt>>
[src]

pub fn to_number<'s>(
    &self,
    scope: &mut HandleScope<'s>
) -> Option<Local<'s, Number>>
[src]

pub fn to_string<'s>(
    &self,
    scope: &mut HandleScope<'s>
) -> Option<Local<'s, String>>
[src]

pub fn to_detail_string<'s>(
    &self,
    scope: &mut HandleScope<'s>
) -> Option<Local<'s, String>>
[src]

pub fn to_object<'s>(
    &self,
    scope: &mut HandleScope<'s>
) -> Option<Local<'s, Object>>
[src]

pub fn to_integer<'s>(
    &self,
    scope: &mut HandleScope<'s>
) -> Option<Local<'s, Integer>>
[src]

pub fn to_uint32<'s>(
    &self,
    scope: &mut HandleScope<'s>
) -> Option<Local<'s, Uint32>>
[src]

pub fn to_int32<'s>(
    &self,
    scope: &mut HandleScope<'s>
) -> Option<Local<'s, Int32>>
[src]

pub fn to_boolean<'s>(
    &self,
    scope: &mut HandleScope<'s, ()>
) -> Local<'s, Boolean>
[src]

Perform the equivalent of Boolean(value) in JS. This can never fail.

pub fn number_value<'s>(&self, scope: &mut HandleScope<'s>) -> Option<f64>[src]

pub fn integer_value<'s>(&self, scope: &mut HandleScope<'s>) -> Option<i64>[src]

pub fn uint32_value<'s>(&self, scope: &mut HandleScope<'s>) -> Option<u32>[src]

pub fn int32_value<'s>(&self, scope: &mut HandleScope<'s>) -> Option<i32>[src]

pub fn boolean_value<'s>(&self, scope: &mut HandleScope<'s, ()>) -> bool[src]

Trait Implementations

impl Deref for Object[src]

type Target = Value

The resulting type after dereferencing.

impl Eq for Object[src]

impl Hash for Object[src]

impl<'s> PartialEq<Array> for Object[src]

impl<'s> PartialEq<ArrayBuffer> for Object[src]

impl<'s> PartialEq<ArrayBufferView> for Object[src]

impl<'s> PartialEq<BigInt64Array> for Object[src]

impl<'s> PartialEq<BigIntObject> for Object[src]

impl<'s> PartialEq<BigUint64Array> for Object[src]

impl<'s> PartialEq<BooleanObject> for Object[src]

impl<'s> PartialEq<Data> for Object[src]

impl<'s> PartialEq<DataView> for Object[src]

impl<'s> PartialEq<Date> for Object[src]

impl<'s> PartialEq<Float32Array> for Object[src]

impl<'s> PartialEq<Float64Array> for Object[src]

impl<'s> PartialEq<Function> for Object[src]

impl<'s> PartialEq<Int16Array> for Object[src]

impl<'s> PartialEq<Int32Array> for Object[src]

impl<'s> PartialEq<Int8Array> for Object[src]

impl<'s> PartialEq<Map> for Object[src]

impl<'s> PartialEq<NumberObject> for Object[src]

impl<'s> PartialEq<Object> for Data[src]

impl<'s> PartialEq<Object> for Value[src]

impl<'s> PartialEq<Object> for Float32Array[src]

impl<'s> PartialEq<Object> for Float64Array[src]

impl<'s> PartialEq<Object> for Int16Array[src]

impl<'s> PartialEq<Object> for Int32Array[src]

impl<'s> PartialEq<Object> for Int8Array[src]

impl<'s> PartialEq<Object> for Uint16Array[src]

impl<'s> PartialEq<Object> for Uint32Array[src]

impl<'s> PartialEq<Object> for Uint8Array[src]

impl<'s> PartialEq<Object> for Uint8ClampedArray[src]

impl<'s> PartialEq<Object> for BigIntObject[src]

impl<'s> PartialEq<Object> for Object[src]

impl<'s> PartialEq<Object> for BooleanObject[src]

impl<'s> PartialEq<Object> for Date[src]

impl<'s> PartialEq<Object> for Function[src]

impl<'s> PartialEq<Object> for Map[src]

impl<'s> PartialEq<Object> for NumberObject[src]

impl<'s> PartialEq<Object> for Promise[src]

impl<'s> PartialEq<Object> for PromiseResolver[src]

impl<'s> PartialEq<Object> for Proxy[src]

impl<'s> PartialEq<Object> for RegExp[src]

impl<'s> PartialEq<Object> for Set[src]

impl<'s> PartialEq<Object> for Array[src]

impl<'s> PartialEq<Object> for SharedArrayBuffer[src]

impl<'s> PartialEq<Object> for StringObject[src]

impl<'s> PartialEq<Object> for SymbolObject[src]

impl<'s> PartialEq<Object> for WasmModuleObject[src]

impl<'s> PartialEq<Object> for ArrayBuffer[src]

impl<'s> PartialEq<Object> for ArrayBufferView[src]

impl<'s> PartialEq<Object> for DataView[src]

impl<'s> PartialEq<Object> for TypedArray[src]

impl<'s> PartialEq<Object> for BigInt64Array[src]

impl<'s> PartialEq<Object> for BigUint64Array[src]

impl<'s> PartialEq<Promise> for Object[src]

impl<'s> PartialEq<PromiseResolver> for Object[src]

impl<'s> PartialEq<Proxy> for Object[src]

impl<'s> PartialEq<RegExp> for Object[src]

impl<'s> PartialEq<Set> for Object[src]

impl<'s> PartialEq<SharedArrayBuffer> for Object[src]

impl<'s> PartialEq<StringObject> for Object[src]

impl<'s> PartialEq<SymbolObject> for Object[src]

impl<'s> PartialEq<TypedArray> for Object[src]

impl<'s> PartialEq<Uint16Array> for Object[src]

impl<'s> PartialEq<Uint32Array> for Object[src]

impl<'s> PartialEq<Uint8Array> for Object[src]

impl<'s> PartialEq<Uint8ClampedArray> for Object[src]

impl<'s> PartialEq<Value> for Object[src]

impl<'s> PartialEq<WasmModuleObject> for Object[src]

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.