pub struct JsObject(_);
Implementations
NB: This is a special JsObject that should only be used in napi_register_module_v1.
pub fn set_named_property(
&mut self,
key: impl AsRef<str>,
value: impl NapiValueT
) -> NapiResult<()>
pub fn set_named_property(
&mut self,
key: impl AsRef<str>,
value: impl NapiValueT
) -> NapiResult<()>
This method is equivalent to calling napi_get_property with a napi_value created from the string passed in as utf8Name.
This API returns the names of the enumerable properties of object as an array of strings. The properties of object whose key is a symbol will not be included.
pub fn set_property(
&mut self,
key: impl NapiValueT,
value: impl NapiValueT
) -> NapiResult<()>
pub fn set_property(
&mut self,
key: impl NapiValueT,
value: impl NapiValueT
) -> NapiResult<()>
This API set a property on the Object passed in.
This API gets the requested property from the Object passed in.
This API checks if the Object passed in has the named property.
This API attempts to delete the key own property from object.
pub fn has_own_property(
&mut self,
key: impl NapiValueT,
value: impl NapiValueT
) -> NapiResult<bool>
pub fn has_own_property(
&mut self,
key: impl NapiValueT,
value: impl NapiValueT
) -> NapiResult<bool>
This API checks if the Object passed in has the named own property. key must be a string or a symbol, or an error will be thrown. Node-API will not perform any conversion between data types.
This method is equivalent to calling napi_get_property with a napi_value created from the string passed in as utf8Name.
This method is equivalent to calling napi_has_property with a napi_value created from the string passed in as utf8Name.
This API sets an element on the Object passed in.
This API gets the element at the requested index.
This API returns if the Object passed in has an element at the requested index.
This API attempts to delete the specified index from object.
Trait Implementations
construct value from raw pointer
napi_value type cast
This API implements the abstract operation ToBoolean() as defined in Section 7.1.2 of the ECMAScript Language Specification. Read more
This API implements the abstract operation ToNumber() as defined in Section 7.1.3 of the ECMAScript Language Specification. This function potentially runs JS code if the passed-in value is an object. Read more
This API implements the abstract operation ToObject() as defined in Section 7.1.13 of the ECMAScript Language Specification. Read more
This API implements the abstract operation ToString() as defined in Section 7.1.13 of the ECMAScript Language Specification. This function potentially runs JS code if the passed-in value is an object. Read more
This API represents invoking the instanceof Operator on the object as defined in Section 12.10.4 of the ECMAScript Language Specification. Read more
This API represents invoking the IsArray operation on the object as defined in Section 7.2.2 of the ECMAScript Language Specification. Read more
This API checks if the Object passed in is an array buffer.
This API checks if the Object passed in is a buffer.
This API checks if the Object passed in is a error.
This API checks if the Object passed in is a typed array.
This API checks if the Object passed in is a DataView.
This API represents the invocation of the Strict Equality algorithm as defined in Section 7.2.14 of the ECMAScript Language Specification. Read more
Returns napi_ok if the API succeeded. Read more
the raw-handle of current value
get null singleton
get undefined singleton
get global singleton
value is throwable
fn define_properties<P>(&self, properties: P) -> NapiResult<()> where
P: AsRef<[NapiPropertyDescriptor]>,
fn define_properties<P>(&self, properties: P) -> NapiResult<()> where
P: AsRef<[NapiPropertyDescriptor]>,
This method allows the efficient definition of multiple properties on a given object. The properties are defined using property descriptors (see napi_property_descriptor). Given an array of such property descriptors, this API will set the properties on the object one at a time, as defined by DefineOwnProperty() (described in Section 9.1.6 of the ECMA-262 specification). Read more
fn gc<Finalizer>(&mut self, finalizer: Finalizer) -> NapiResult<NapiRef> where
Finalizer: FnOnce(NapiEnv) -> NapiResult<()>,
fn gc<Finalizer>(&mut self, finalizer: Finalizer) -> NapiResult<NapiRef> where
Finalizer: FnOnce(NapiEnv) -> NapiResult<()>,
This is a hook which is fired when the value is gabage-collected. For napi >= 5, we use napi_add_finalizer, For napi < 5, we use napi_wrap. Read more
fn wrap<T, Finalizer>(
&mut self,
data: T,
finalizer: Finalizer
) -> NapiResult<NapiRef> where
Finalizer: FnOnce(NapiEnv, T) -> NapiResult<()>,
fn wrap<T, Finalizer>(
&mut self,
data: T,
finalizer: Finalizer
) -> NapiResult<NapiRef> where
Finalizer: FnOnce(NapiEnv, T) -> NapiResult<()>,
Wraps a native instance in a JavaScript object. The native instance can be retrieved later using napi_unwrap(). Read more
Retrieves a native instance that was previously wrapped in a JavaScript object using napi_wrap(). Read more
Retrieves a native instance that was previously wrapped in the JavaScript object js_object using napi_wrap() and removes the wrapping. If a finalize callback was associated with the wrapping, it will no longer be called when the JavaScript object becomes garbage-collected. Read more
Auto Trait Implementations
impl RefUnwindSafe for JsObject
impl UnwindSafe for JsObject
Blanket Implementations
Mutably borrows from an owned value. Read more