pub struct NapiRef(_, _);
Implementations
sourceimpl NapiRef
impl NapiRef
sourcepub fn new<T: NapiValueT>(value: T, count: u32) -> NapiResult<NapiRef>
pub fn new<T: NapiValueT>(value: T, count: u32) -> NapiResult<NapiRef>
This API creates a new reference with the specified reference count to the Object passed in.
sourcepub fn inc(&mut self) -> NapiResult<u32>
pub fn inc(&mut self) -> NapiResult<u32>
This API increments the reference count for the reference passed in and returns the resulting reference count.
sourcepub fn dec(&mut self) -> NapiResult<u32>
pub fn dec(&mut self) -> NapiResult<u32>
This API decrements the reference count for the reference passed in and returns the resulting reference count.
sourcepub fn deref<T: NapiValueT>(&self) -> NapiResult<T>
pub fn deref<T: NapiValueT>(&self) -> NapiResult<T>
If still valid, this API returns the napi_value representing the JavaScript Object associated with the napi_ref. Otherwise, result will be NULL.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for NapiRef
impl !Send for NapiRef
impl !Sync for NapiRef
impl Unpin for NapiRef
impl UnwindSafe for NapiRef
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more