#[repr(C)]
pub struct JsValue(_, _);

Implementations

NapiEnv of this JsValue

raw napi_value of this JsValue

check if it is an object

view it as an object, may fail if it is not an object value

check if it is a string

view it as a string, may fail if it is not a string value

check if it is a symbol

view it as a symbol, may fail if it is not a symbol value

view it as an array, may fail if it is not an array value

view it as a typed_array, may fail if it is not a typed_array value

view it as an array_buffer, may faile if it is not an array_buffer value

view it as a buffer, may faile if it is not a buffer value

view it as a dataview, may faile if it is not a dataview value

check if it is an external

view it as an external, may fail if it is not an external value

check if it is a function

view it as a number, may fail if it is not a number value

check if it is a number

view it as a number, may fail if it is not a number value

check if it is a bigint

view it as a bigint, may fail if it is not a bigint value

check if it is a boolean

view it as a boolean, may fail if it is not a boolean value

This API checks if the Object passed in is a promise.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

construct value from raw pointer

inner value

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 NapiEnv of current value

the raw-handle of current value

get null singleton

get undefined singleton

get global singleton

value is throwable

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

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

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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.