Struct napi_h::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>
pub fn new(value: T) -> Self
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
impl<T: 'static + Send> Send for External<T>
impl<T: 'static + Sync> Sync for External<T>
Auto Trait Implementations§
impl<T> Freeze for External<T>
impl<T> RefUnwindSafe for External<T>where
T: RefUnwindSafe,
impl<T> Unpin for External<T>
impl<T> UnwindSafe for External<T>where
T: RefUnwindSafe,
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