[−][src]Struct js_sys::Object
Methods
impl Object
[src]
impl Object
pub fn assign(target: &Object, source: &Object) -> Object
[src]
pub fn assign(target: &Object, source: &Object) -> Object
The Object.assign() method is used to copy the values of all enumerable own properties from one or more source objects to a target object. It will return the target object.
impl Object
[src]
impl Object
pub fn assign2(target: &Object, source1: &Object, source2: &Object) -> Object
[src]
pub fn assign2(target: &Object, source1: &Object, source2: &Object) -> Object
The Object.assign() method is used to copy the values of all enumerable own properties from one or more source objects to a target object. It will return the target object.
impl Object
[src]
impl Object
pub fn assign3(
target: &Object,
source1: &Object,
source2: &Object,
source3: &Object
) -> Object
[src]
pub fn assign3(
target: &Object,
source1: &Object,
source2: &Object,
source3: &Object
) -> Object
The Object.assign() method is used to copy the values of all enumerable own properties from one or more source objects to a target object. It will return the target object.
impl Object
[src]
impl Object
pub fn create(prototype: &Object) -> Object
[src]
pub fn create(prototype: &Object) -> Object
The Object.create() method creates a new object, using an existing object to provide the newly created object's prototype.
impl Object
[src]
impl Object
pub fn define_property(
obj: &Object,
prop: &JsValue,
descriptor: &Object
) -> Object
[src]
pub fn define_property(
obj: &Object,
prop: &JsValue,
descriptor: &Object
) -> Object
The static method Object.defineProperty() defines a new property directly on an object, or modifies an existing property on an object, and returns the object.
impl Object
[src]
impl Object
pub fn define_properties(obj: &Object, props: &Object) -> Object
[src]
pub fn define_properties(obj: &Object, props: &Object) -> Object
The Object.defineProperties() method defines new or modifies existing properties directly on an object, returning the object.
impl Object
[src]
impl Object
pub fn entries(object: &Object) -> Array
[src]
pub fn entries(object: &Object) -> Array
The Object.entries() method returns an array of a given object's own enumerable property [key, value] pairs, in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
impl Object
[src]
impl Object
pub fn freeze(value: &Object) -> Object
[src]
pub fn freeze(value: &Object) -> Object
The Object.freeze()
method freezes an object: that is, prevents new
properties from being added to it; prevents existing properties from
being removed; and prevents existing properties, or their enumerability,
configurability, or writability, from being changed, it also prevents
the prototype from being changed. The method returns the passed object.
impl Object
[src]
impl Object
pub fn get_own_property_descriptor(obj: &Object, prop: &JsValue) -> JsValue
[src]
pub fn get_own_property_descriptor(obj: &Object, prop: &JsValue) -> JsValue
The Object.getOwnPropertyDescriptor() method returns a property descriptor for an own property (that is, one directly present on an object and not in the object's prototype chain) of a given object.
impl Object
[src]
impl Object
pub fn get_own_property_descriptors(obj: &Object) -> JsValue
[src]
pub fn get_own_property_descriptors(obj: &Object) -> JsValue
The Object.getOwnPropertyDescriptors() method returns all own property descriptors of a given object.
impl Object
[src]
impl Object
pub fn get_own_property_names(obj: &Object) -> Array
[src]
pub fn get_own_property_names(obj: &Object) -> Array
The Object.getOwnPropertyNames() method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly upon a given object.
impl Object
[src]
impl Object
pub fn get_own_property_symbols(obj: &Object) -> Array
[src]
pub fn get_own_property_symbols(obj: &Object) -> Array
The Object.getOwnPropertySymbols() method returns an array of all symbol properties found directly upon a given object.
impl Object
[src]
impl Object
pub fn get_prototype_of(obj: &JsValue) -> Object
[src]
pub fn get_prototype_of(obj: &JsValue) -> Object
The Object.getPrototypeOf() method returns the prototype (i.e. the value of the internal [[Prototype]] property) of the specified object.
impl Object
[src]
impl Object
pub fn has_own_property(&self, property: &JsValue) -> bool
[src]
pub fn has_own_property(&self, property: &JsValue) -> bool
The hasOwnProperty()
method returns a boolean indicating whether the
object has the specified property as its own property (as opposed to
inheriting it).
impl Object
[src]
impl Object
pub fn is(value_1: &JsValue, value_2: &JsValue) -> bool
[src]
pub fn is(value_1: &JsValue, value_2: &JsValue) -> bool
The Object.is() method determines whether two values are the same value.
impl Object
[src]
impl Object
pub fn is_extensible(object: &Object) -> bool
[src]
pub fn is_extensible(object: &Object) -> bool
The Object.isExtensible()
method determines if an object is extensible
(whether it can have new properties added to it).
impl Object
[src]
impl Object
pub fn is_frozen(object: &Object) -> bool
[src]
pub fn is_frozen(object: &Object) -> bool
The Object.isFrozen()
determines if an object is frozen.
impl Object
[src]
impl Object
pub fn is_sealed(object: &Object) -> bool
[src]
pub fn is_sealed(object: &Object) -> bool
The Object.isSealed()
method determines if an object is sealed.
impl Object
[src]
impl Object
pub fn is_prototype_of(&self, value: &JsValue) -> bool
[src]
pub fn is_prototype_of(&self, value: &JsValue) -> bool
The isPrototypeOf()
method checks if an object exists in another
object's prototype chain.
impl Object
[src]
impl Object
pub fn keys(object: &Object) -> Array
[src]
pub fn keys(object: &Object) -> Array
The Object.keys()
method returns an array of a given object's property
names, in the same order as we get with a normal loop.
impl Object
[src]
impl Object
impl Object
[src]
impl Object
pub fn prevent_extensions(object: &Object)
[src]
pub fn prevent_extensions(object: &Object)
The Object.preventExtensions()
method prevents new properties from
ever being added to an object (i.e. prevents future extensions to the
object).
impl Object
[src]
impl Object
pub fn property_is_enumerable(&self, property: &JsValue) -> bool
[src]
pub fn property_is_enumerable(&self, property: &JsValue) -> bool
The propertyIsEnumerable()
method returns a Boolean indicating
whether the specified property is enumerable.
impl Object
[src]
impl Object
pub fn seal(value: &Object) -> Object
[src]
pub fn seal(value: &Object) -> Object
The Object.seal()
method seals an object, preventing new properties
from being added to it and marking all existing properties as
non-configurable. Values of present properties can still be changed as
long as they are writable.
impl Object
[src]
impl Object
pub fn set_prototype_of(object: &Object, prototype: &Object) -> Object
[src]
pub fn set_prototype_of(object: &Object, prototype: &Object) -> Object
The Object.setPrototypeOf()
method sets the prototype (i.e., the
internal [[Prototype]]
property) of a specified object to another
object or null
.
impl Object
[src]
impl Object
pub fn to_locale_string(&self) -> JsString
[src]
pub fn to_locale_string(&self) -> JsString
The toLocaleString()
method returns a string representing the object.
This method is meant to be overridden by derived objects for
locale-specific purposes.
impl Object
[src]
impl Object
pub fn to_string(&self) -> JsString
[src]
pub fn to_string(&self) -> JsString
The toString()
method returns a string representing the object.
impl Object
[src]
impl Object
pub fn value_of(&self) -> Object
[src]
pub fn value_of(&self) -> Object
The valueOf()
method returns the primitive value of the
specified object.
impl Object
[src]
impl Object
pub fn values(object: &Object) -> Array
[src]
pub fn values(object: &Object) -> Array
The Object.values()
method returns an array of a given object's own
enumerable property values, in the same order as that provided by a
for...in
loop (the difference being that a for-in loop enumerates
properties in the prototype chain as well).
impl Object
[src]
impl Object
pub fn try_from(val: &JsValue) -> Option<&Object>
[src]
pub fn try_from(val: &JsValue) -> Option<&Object>
Returns the Object
value of this JS value if it's an instance of an
object.
If this JS value is not an instance of an object then this returns
None
.
Methods from Deref<Target = JsValue>
pub const NULL: JsValue
[src]
pub const UNDEFINED: JsValue
[src]
pub const TRUE: JsValue
[src]
pub const FALSE: JsValue
[src]
pub fn as_f64(&self) -> Option<f64>
[src]
pub fn as_f64(&self) -> Option<f64>
Returns the f64
value of this JS value if it's an instance of a
number.
If this JS value is not an instance of a number then this returns
None
.
pub fn is_string(&self) -> bool
[src]
pub fn is_string(&self) -> bool
Tests whether this JS value is a JS string.
pub fn as_string(&self) -> Option<String>
[src]
pub fn as_string(&self) -> Option<String>
If this JS value is a string value, this function copies the JS string
value into wasm linear memory, encoded as UTF-8, and returns it as a
Rust String
.
To avoid the copying and re-encoding, consider the
JsString::try_from()
function from js-sys
instead.
If this JS value is not an instance of a string or if it's not valid
utf-8 then this returns None
.
pub fn as_bool(&self) -> Option<bool>
[src]
pub fn as_bool(&self) -> Option<bool>
Returns the bool
value of this JS value if it's an instance of a
boolean.
If this JS value is not an instance of a boolean then this returns
None
.
pub fn is_null(&self) -> bool
[src]
pub fn is_null(&self) -> bool
Tests whether this JS value is null
pub fn is_undefined(&self) -> bool
[src]
pub fn is_undefined(&self) -> bool
Tests whether this JS value is undefined
pub fn is_symbol(&self) -> bool
[src]
pub fn is_symbol(&self) -> bool
Tests whether the type of this JS value is symbol
pub fn is_object(&self) -> bool
[src]
pub fn is_object(&self) -> bool
Tests whether typeof self == "object" && self !== null
.
pub fn is_function(&self) -> bool
[src]
pub fn is_function(&self) -> bool
Tests whether the type of this JS value is function
.
Trait Implementations
impl AsRef<Object> for Array
[src]
impl AsRef<Object> for Array
impl AsRef<Object> for ArrayBuffer
[src]
impl AsRef<Object> for ArrayBuffer
impl AsRef<Object> for Boolean
[src]
impl AsRef<Object> for Boolean
impl AsRef<Object> for DataView
[src]
impl AsRef<Object> for DataView
impl AsRef<Object> for Error
[src]
impl AsRef<Object> for Error
impl AsRef<Object> for EvalError
[src]
impl AsRef<Object> for EvalError
impl AsRef<Object> for Function
[src]
impl AsRef<Object> for Function
impl AsRef<Object> for Generator
[src]
impl AsRef<Object> for Generator
impl AsRef<Object> for Map
[src]
impl AsRef<Object> for Map
impl AsRef<Object> for Math
[src]
impl AsRef<Object> for Math
impl AsRef<Object> for Number
[src]
impl AsRef<Object> for Number
impl AsRef<Object> for Date
[src]
impl AsRef<Object> for Date
impl AsRef<JsValue> for Object
[src]
impl AsRef<JsValue> for Object
impl AsRef<Object> for RangeError
[src]
impl AsRef<Object> for RangeError
impl AsRef<Object> for ReferenceError
[src]
impl AsRef<Object> for ReferenceError
impl AsRef<Object> for Reflect
[src]
impl AsRef<Object> for Reflect
impl AsRef<Object> for RegExp
[src]
impl AsRef<Object> for RegExp
impl AsRef<Object> for Set
[src]
impl AsRef<Object> for Set
impl AsRef<Object> for SyntaxError
[src]
impl AsRef<Object> for SyntaxError
impl AsRef<Object> for TypeError
[src]
impl AsRef<Object> for TypeError
impl AsRef<Object> for UriError
[src]
impl AsRef<Object> for UriError
impl AsRef<Object> for WeakMap
[src]
impl AsRef<Object> for WeakMap
impl AsRef<Object> for WeakSet
[src]
impl AsRef<Object> for WeakSet
impl AsRef<Object> for Instance
[src]
impl AsRef<Object> for Instance
impl AsRef<Object> for Module
[src]
impl AsRef<Object> for Module
impl AsRef<Object> for Table
[src]
impl AsRef<Object> for Table
impl AsRef<Object> for Memory
[src]
impl AsRef<Object> for Memory
impl AsRef<Object> for JSON
[src]
impl AsRef<Object> for JSON
impl AsRef<Object> for JsString
[src]
impl AsRef<Object> for JsString
impl AsRef<Object> for Collator
[src]
impl AsRef<Object> for Collator
impl AsRef<Object> for DateTimeFormat
[src]
impl AsRef<Object> for DateTimeFormat
impl AsRef<Object> for NumberFormat
[src]
impl AsRef<Object> for NumberFormat
impl AsRef<Object> for PluralRules
[src]
impl AsRef<Object> for PluralRules
impl AsRef<Object> for Promise
[src]
impl AsRef<Object> for Promise
impl AsRef<Object> for Int8Array
[src]
impl AsRef<Object> for Int8Array
impl AsRef<Object> for Int16Array
[src]
impl AsRef<Object> for Int16Array
impl AsRef<Object> for Int32Array
[src]
impl AsRef<Object> for Int32Array
impl AsRef<Object> for Uint8Array
[src]
impl AsRef<Object> for Uint8Array
impl AsRef<Object> for Uint8ClampedArray
[src]
impl AsRef<Object> for Uint8ClampedArray
impl AsRef<Object> for Uint16Array
[src]
impl AsRef<Object> for Uint16Array
impl AsRef<Object> for Uint32Array
[src]
impl AsRef<Object> for Uint32Array
impl AsRef<Object> for Float32Array
[src]
impl AsRef<Object> for Float32Array
impl AsRef<Object> for Float64Array
[src]
impl AsRef<Object> for Float64Array
impl From<Array> for Object
[src]
impl From<Array> for Object
impl From<ArrayBuffer> for Object
[src]
impl From<ArrayBuffer> for Object
fn from(obj: ArrayBuffer) -> Object
[src]
fn from(obj: ArrayBuffer) -> Object
impl From<Boolean> for Object
[src]
impl From<Boolean> for Object
impl From<DataView> for Object
[src]
impl From<DataView> for Object
impl From<Error> for Object
[src]
impl From<Error> for Object
impl From<EvalError> for Object
[src]
impl From<EvalError> for Object
impl From<Function> for Object
[src]
impl From<Function> for Object
impl From<Generator> for Object
[src]
impl From<Generator> for Object
impl From<Map> for Object
[src]
impl From<Map> for Object
impl From<Math> for Object
[src]
impl From<Math> for Object
impl From<Number> for Object
[src]
impl From<Number> for Object
impl From<Date> for Object
[src]
impl From<Date> for Object
impl From<JsValue> for Object
[src]
impl From<JsValue> for Object
impl From<Object> for JsValue
[src]
impl From<Object> for JsValue
impl From<RangeError> for Object
[src]
impl From<RangeError> for Object
fn from(obj: RangeError) -> Object
[src]
fn from(obj: RangeError) -> Object
impl From<ReferenceError> for Object
[src]
impl From<ReferenceError> for Object
fn from(obj: ReferenceError) -> Object
[src]
fn from(obj: ReferenceError) -> Object
impl From<Reflect> for Object
[src]
impl From<Reflect> for Object
impl From<RegExp> for Object
[src]
impl From<RegExp> for Object
impl From<Set> for Object
[src]
impl From<Set> for Object
impl From<SyntaxError> for Object
[src]
impl From<SyntaxError> for Object
fn from(obj: SyntaxError) -> Object
[src]
fn from(obj: SyntaxError) -> Object
impl From<TypeError> for Object
[src]
impl From<TypeError> for Object
impl From<UriError> for Object
[src]
impl From<UriError> for Object
impl From<WeakMap> for Object
[src]
impl From<WeakMap> for Object
impl From<WeakSet> for Object
[src]
impl From<WeakSet> for Object
impl From<Instance> for Object
[src]
impl From<Instance> for Object
impl From<Module> for Object
[src]
impl From<Module> for Object
impl From<Table> for Object
[src]
impl From<Table> for Object
impl From<Memory> for Object
[src]
impl From<Memory> for Object
impl From<JSON> for Object
[src]
impl From<JSON> for Object
impl From<JsString> for Object
[src]
impl From<JsString> for Object
impl From<Collator> for Object
[src]
impl From<Collator> for Object
impl From<DateTimeFormat> for Object
[src]
impl From<DateTimeFormat> for Object
fn from(obj: DateTimeFormat) -> Object
[src]
fn from(obj: DateTimeFormat) -> Object
impl From<NumberFormat> for Object
[src]
impl From<NumberFormat> for Object
fn from(obj: NumberFormat) -> Object
[src]
fn from(obj: NumberFormat) -> Object
impl From<PluralRules> for Object
[src]
impl From<PluralRules> for Object
fn from(obj: PluralRules) -> Object
[src]
fn from(obj: PluralRules) -> Object
impl From<Promise> for Object
[src]
impl From<Promise> for Object
impl From<Int8Array> for Object
[src]
impl From<Int8Array> for Object
impl From<Int16Array> for Object
[src]
impl From<Int16Array> for Object
fn from(obj: Int16Array) -> Object
[src]
fn from(obj: Int16Array) -> Object
impl From<Int32Array> for Object
[src]
impl From<Int32Array> for Object
fn from(obj: Int32Array) -> Object
[src]
fn from(obj: Int32Array) -> Object
impl From<Uint8Array> for Object
[src]
impl From<Uint8Array> for Object
fn from(obj: Uint8Array) -> Object
[src]
fn from(obj: Uint8Array) -> Object
impl From<Uint8ClampedArray> for Object
[src]
impl From<Uint8ClampedArray> for Object
fn from(obj: Uint8ClampedArray) -> Object
[src]
fn from(obj: Uint8ClampedArray) -> Object
impl From<Uint16Array> for Object
[src]
impl From<Uint16Array> for Object
fn from(obj: Uint16Array) -> Object
[src]
fn from(obj: Uint16Array) -> Object
impl From<Uint32Array> for Object
[src]
impl From<Uint32Array> for Object
fn from(obj: Uint32Array) -> Object
[src]
fn from(obj: Uint32Array) -> Object
impl From<Float32Array> for Object
[src]
impl From<Float32Array> for Object
fn from(obj: Float32Array) -> Object
[src]
fn from(obj: Float32Array) -> Object
impl From<Float64Array> for Object
[src]
impl From<Float64Array> for Object
fn from(obj: Float64Array) -> Object
[src]
fn from(obj: Float64Array) -> Object
impl Clone for Object
[src]
impl Clone for Object
fn clone(&self) -> Object
[src]
fn clone(&self) -> Object
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Object
[src]
impl Debug for Object
impl Deref for Object
[src]
impl Deref for Object
impl WasmDescribe for Object
[src]
impl WasmDescribe for Object
impl IntoWasmAbi for Object
[src]
impl IntoWasmAbi for Object
type Abi = <JsValue as IntoWasmAbi>::Abi
The wasm ABI type that this converts into when crossing the ABI boundary. Read more
fn into_abi(self, extra: &mut dyn Stack) -> Self::Abi
[src]
fn into_abi(self, extra: &mut dyn Stack) -> Self::Abi
impl<'a> IntoWasmAbi for &'a Object
[src]
impl<'a> IntoWasmAbi for &'a Object
type Abi = <&'a JsValue as IntoWasmAbi>::Abi
The wasm ABI type that this converts into when crossing the ABI boundary. Read more
fn into_abi(self, extra: &mut dyn Stack) -> Self::Abi
[src]
fn into_abi(self, extra: &mut dyn Stack) -> Self::Abi
impl FromWasmAbi for Object
[src]
impl FromWasmAbi for Object
type Abi = <JsValue as FromWasmAbi>::Abi
The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more
unsafe fn from_abi(js: Self::Abi, extra: &mut dyn Stack) -> Self
[src]
unsafe fn from_abi(js: Self::Abi, extra: &mut dyn Stack) -> Self
impl OptionFromWasmAbi for Object
[src]
impl OptionFromWasmAbi for Object
impl RefFromWasmAbi for Object
[src]
impl RefFromWasmAbi for Object
type Abi = <JsValue as RefFromWasmAbi>::Abi
The wasm ABI type references to Self
are recovered from.
type Anchor = ManuallyDrop<Object>
The type that holds the reference to Self
for the duration of the invocation of the function that has an &Self
parameter. This is required to ensure that the lifetimes don't persist beyond one function call, and so that they remain anonymous. Read more
unsafe fn ref_from_abi(js: Self::Abi, extra: &mut dyn Stack) -> Self::Anchor
[src]
unsafe fn ref_from_abi(js: Self::Abi, extra: &mut dyn Stack) -> Self::Anchor
impl OptionIntoWasmAbi for Object
[src]
impl OptionIntoWasmAbi for Object
impl<'a> OptionIntoWasmAbi for &'a Object
[src]
impl<'a> OptionIntoWasmAbi for &'a Object
impl JsCast for Object
[src]
impl JsCast for Object
fn instanceof(val: &JsValue) -> bool
[src]
fn instanceof(val: &JsValue) -> bool
fn unchecked_from_js(val: JsValue) -> Self
[src]
fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self
[src]
fn unchecked_from_js_ref(val: &JsValue) -> &Self
fn is_instance_of<T>(&self) -> bool where
T: JsCast,
[src]
fn is_instance_of<T>(&self) -> bool where
T: JsCast,
Test whether this JS value is an instance of the type T
. Read more
fn dyn_into<T>(self) -> Result<T, Self> where
T: JsCast,
[src]
fn dyn_into<T>(self) -> Result<T, Self> where
T: JsCast,
Performs a dynamic cast (checked at runtime) of this value into the target type T
. Read more
fn dyn_ref<T>(&self) -> Option<&T> where
T: JsCast,
[src]
fn dyn_ref<T>(&self) -> Option<&T> where
T: JsCast,
Performs a dynamic cast (checked at runtime) of this value into the target type T
. Read more
fn unchecked_into<T>(self) -> T where
T: JsCast,
[src]
fn unchecked_into<T>(self) -> T where
T: JsCast,
Performs a zero-cost unchecked cast into the specified type. Read more
fn unchecked_ref<T>(&self) -> &T where
T: JsCast,
[src]
fn unchecked_ref<T>(&self) -> &T where
T: JsCast,
Performs a zero-cost unchecked cast into a reference to the specified type. Read more
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
[src]
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
fn return_abi(self, extra: &mut dyn Stack) -> <T as ReturnWasmAbi>::Abi
[src]
fn return_abi(self, extra: &mut dyn Stack) -> <T as ReturnWasmAbi>::Abi