JsTypedArray

Struct JsTypedArray 

Source
pub struct JsTypedArray(/* private fields */);
๐Ÿ‘ŽDeprecated since 3.0.0: Use napi::bindgen_prelude::Uint8Array/Int8Array... instead

Implementationsยง

Sourceยง

impl JsTypedArray

Source

pub fn into_value(self) -> Result<JsTypedArrayValue>

get TypeArray info https://nodejs.org/api/n-api.html#n_api_napi_get_typedarray_info

Warning: Use caution while using this API since the underlying data buffer is managed by the VM.

Sourceยง

impl JsTypedArray

Source

pub fn into_unknown<'env>(self) -> Unknown<'env>

Source

pub fn coerce_to_bool(self) -> Result<JsBoolean>

Source

pub fn coerce_to_number<'env>(self) -> Result<JsNumber<'env>>

Source

pub fn coerce_to_string<'env>(self) -> Result<JsString<'env>>

Source

pub fn coerce_to_object(self) -> Result<JsObject>

Source

pub fn is_date(&self) -> Result<bool>

Source

pub fn is_promise(&self) -> Result<bool>

Source

pub fn is_error(&self) -> Result<bool>

Source

pub fn is_typedarray(&self) -> Result<bool>

Source

pub fn is_dataview(&self) -> Result<bool>

Source

pub fn is_array(&self) -> Result<bool>

Source

pub fn is_buffer(&self) -> Result<bool>

Source

pub fn is_arraybuffer(&self) -> Result<bool>

Source

pub fn instanceof<Constructor>(&self, constructor: Constructor) -> Result<bool>
where Constructor: NapiRaw,

Sourceยง

impl JsTypedArray

Source

pub fn set_property<K, V>(&mut self, key: K, value: V) -> Result<()>
where K: ToNapiValue, V: ToNapiValue,

Source

pub fn get_property<K, T>(&self, key: K) -> Result<T>

Source

pub fn get_property_unchecked<K, T>(&self, key: K) -> Result<T>
where K: NapiRaw, T: NapiValue,

Source

pub fn set_named_property<T>(&mut self, name: &str, value: T) -> Result<()>
where T: ToNapiValue,

Source

pub fn create_named_method( &mut self, name: &str, function: Callback, ) -> Result<()>

Source

pub fn get_named_property<T>(&self, name: &str) -> Result<T>

Source

pub fn get_named_property_unchecked<T>(&self, name: &str) -> Result<T>
where T: FromNapiValue,

Source

pub fn has_named_property<N: AsRef<str>>(&self, name: N) -> Result<bool>

Source

pub fn delete_property<S>(&mut self, name: S) -> Result<bool>
where S: ToNapiValue,

Source

pub fn delete_named_property(&mut self, name: &str) -> Result<bool>

Source

pub fn has_own_property(&self, key: &str) -> Result<bool>

Source

pub fn has_own_property_js<K>(&self, key: K) -> Result<bool>
where K: ToNapiValue,

Source

pub fn has_property(&self, name: &str) -> Result<bool>

Source

pub fn has_property_js<K>(&self, name: K) -> Result<bool>
where K: ToNapiValue,

Source

pub fn get_property_names(&self) -> Result<JsObject>

Source

pub fn get_all_property_names( &self, mode: KeyCollectionMode, filter: KeyFilter, conversion: KeyConversion, ) -> Result<JsObject>

Source

pub fn get_prototype<T>(&self) -> Result<T>
where T: NapiValue,

This returns the equivalent of Object.getPrototypeOf (which is not the same as the functionโ€™s prototype property).

Source

pub fn get_prototype_unchecked<T>(&self) -> Result<T>
where T: NapiValue,

Source

pub fn set_element<T>(&mut self, index: u32, value: T) -> Result<()>
where T: ToNapiValue,

Source

pub fn has_element(&self, index: u32) -> Result<bool>

Source

pub fn delete_element(&mut self, index: u32) -> Result<bool>

Source

pub fn get_element<T>(&self, index: u32) -> Result<T>
where T: FromNapiValue,

Source

pub fn get_element_unchecked<T>(&self, index: u32) -> Result<T>
where T: NapiValue,

Source

pub fn define_properties(&mut self, properties: &[Property]) -> Result<()>

This method allows the efficient definition of multiple properties on a given object.

Source

pub fn get_array_length(&self) -> Result<u32>

Perform is_array check before get the length if Object is not array, ArrayExpected error returned

Source

pub fn get_array_length_unchecked(&self) -> Result<u32>

use this API if you can ensure this Object is Array

Source

pub fn freeze(&mut self) -> Result<()>

Source

pub fn seal(&mut self) -> Result<()>

Trait Implementationsยง

Sourceยง

impl FromNapiValue for JsTypedArray

Sourceยง

unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>

Safety Read more
Sourceยง

fn from_unknown(value: Unknown<'_>) -> Result<Self>

Sourceยง

impl JsValue<'_> for JsTypedArray

Sourceยง

fn value(&self) -> Value

Sourceยง

fn raw(&self) -> napi_value

Sourceยง

fn to_unknown(&self) -> Unknown<'env>

Convert the value to an unknown
Sourceยง

fn coerce_to_bool(&self) -> Result<bool>

Coerce the value to a boolean
Sourceยง

fn coerce_to_number(&self) -> Result<JsNumber<'_>>

Sourceยง

fn coerce_to_string(&self) -> Result<JsString<'_>>

Sourceยง

fn coerce_to_object(&self) -> Result<Object<'env>>

Sourceยง

fn is_date(&self) -> Result<bool>

Sourceยง

fn is_promise(&self) -> Result<bool>

Sourceยง

fn is_error(&self) -> Result<bool>

Sourceยง

fn is_typedarray(&self) -> Result<bool>

Sourceยง

fn is_dataview(&self) -> Result<bool>

Sourceยง

fn is_array(&self) -> Result<bool>

Sourceยง

fn is_buffer(&self) -> Result<bool>

Sourceยง

fn is_arraybuffer(&self) -> Result<bool>

Sourceยง

fn instanceof<'c, Constructor>(&self, constructor: Constructor) -> Result<bool>
where Constructor: JsValue<'c>,

Sourceยง

fn escape<'scope, E: JsValue<'scope> + FromNapiValue>( &self, escapable_handle_scope: EscapableHandleScope<'scope>, ) -> Result<E>

Sourceยง

impl<'env> NapiRaw for &'env JsTypedArray

Sourceยง

unsafe fn raw(&self) -> napi_value

Sourceยง

impl NapiRaw for JsTypedArray

Sourceยง

unsafe fn raw(&self) -> napi_value

Sourceยง

impl NapiValue for JsTypedArray

Sourceยง

impl TryFrom<Unknown<'_>> for JsTypedArray

Sourceยง

type Error = Error

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: Unknown<'_>) -> Result<JsTypedArray>

Performs the conversion.
Sourceยง

impl TypeName for JsTypedArray

Auto Trait Implementationsยง

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<'env, T> JsValuesTuple for T
where T: JsValue<'env>,

Sourceยง

impl<T> JsValuesTupleIntoVec for T
where T: ToNapiValue,

Sourceยง

impl<'env, T> ToNapiValue for T
where T: JsValue<'env>,

Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

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

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.