Struct napi::bindgen_prelude::External
source · pub struct External<T: 'static> {
pub adjusted_size: i64,
/* private fields */
}
Fields§
§adjusted_size: i64
Implementations§
source§impl<T: 'static> External<T>
impl<T: 'static> External<T>
sourcepub fn new_with_size_hint(value: T, size_hint: usize) -> Self
pub fn new_with_size_hint(value: T, size_hint: usize) -> Self
size_hint
is a value to tell Node.js GC how much memory is used by this External
object.
If getting the exact size_hint
is difficult, you can provide an approximate value, it’s only effect to the GC.
If your External
object is not effect to GC, you can use External::new
instead.
Trait Implementations§
source§impl<T: 'static> FromNapiValue for External<T>
impl<T: 'static> FromNapiValue for External<T>
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<T: 'static> ToNapiValue for External<T>
impl<T: 'static> ToNapiValue for External<T>
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<T: 'static> ValidateNapiValue for External<T>
impl<T: 'static> ValidateNapiValue for External<T>
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