Struct napi::JsObject [−][src]
pub struct JsObject(_);
Implementations
pub fn add_finalizer<T, Hint, F>(
&mut self,
native: T,
finalize_hint: Hint,
finalize_cb: F
) -> Result<()> where
T: 'static,
Hint: 'static,
F: FnOnce(FinalizeContext<T, Hint>),
pub fn instanceof<Constructor>(&self, constructor: Constructor) -> Result<bool> where
Constructor: NapiRaw,
pub fn get_property_unchecked<K, T>(&self, key: K) -> Result<T> where
K: NapiRaw,
T: NapiValue,
pub fn get_all_property_names(
&self,
mode: KeyCollectionMode,
filter: KeyFilter,
conversion: KeyConversion
) -> Result<JsObject>
pub fn get_all_property_names(
&self,
mode: KeyCollectionMode,
filter: KeyFilter,
conversion: KeyConversion
) -> Result<JsObject>
https://nodejs.org/api/n-api.html#n_api_napi_get_all_property_names
return Array
of property names
This returns the equivalent of Object.getPrototypeOf
(which is not the same as the function’s prototype property).
This method allows the efficient definition of multiple properties on a given object.
Perform is_array
check before get the length
if Object
is not array, ArrayExpected
error returned
use this API if you can ensure this Object
is Array