Struct napi_h::bindgen_prelude::Array
source · pub struct Array { /* private fields */ }
Implementations§
source§impl Array
impl Array
pub fn get<T: FromNapiValue>(&self, index: u32) -> Result<Option<T>>
pub fn set<T: ToNapiValue>(&mut self, index: u32, val: T) -> Result<()>
pub fn insert<T: ToNapiValue>(&mut self, val: T) -> Result<()>
pub fn len(&self) -> u32
pub fn coerce_to_object(self) -> Result<JsObject>
source§impl Array
impl Array
sourcepub fn from_vec<T>(env: &Env, value: Vec<T>) -> Result<Self>where
T: ToNapiValue,
pub fn from_vec<T>(env: &Env, value: Vec<T>) -> Result<Self>where
T: ToNapiValue,
Create Array
from Vec<T>
sourcepub fn from_ref_vec_string(env: &Env, value: &[String]) -> Result<Self>
pub fn from_ref_vec_string(env: &Env, value: &[String]) -> Result<Self>
Create Array
from &Vec<String>
sourcepub fn from_ref_vec<T>(env: &Env, value: &[T]) -> Result<Self>where
T: ToNapiValue + Copy,
pub fn from_ref_vec<T>(env: &Env, value: &[T]) -> Result<Self>where
T: ToNapiValue + Copy,
Create Array
from &Vec<T: Copy + ToNapiValue>
Trait Implementations§
source§impl FromNapiValue for Array
impl FromNapiValue for Array
source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self>
source§impl ToNapiValue for Array
impl ToNapiValue for Array
source§unsafe fn to_napi_value(_env: napi_env, val: Self) -> Result<napi_value>
unsafe fn to_napi_value(_env: napi_env, val: Self) -> Result<napi_value>
Safety Read more
source§impl ValidateNapiValue for Array
impl ValidateNapiValue for Array
source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Auto Trait Implementations§
impl Freeze for Array
impl RefUnwindSafe for Array
impl !Send for Array
impl !Sync for Array
impl Unpin for Array
impl UnwindSafe for Array
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more