pub struct ThreadsafeFunctionHandle { /* private fields */ }Implementations§
Source§impl ThreadsafeFunctionHandle
impl ThreadsafeFunctionHandle
Sourcepub fn new(raw: napi_threadsafe_function) -> Arc<Self>
pub fn new(raw: napi_threadsafe_function) -> Arc<Self>
create a Arc to hold the ThreadsafeFunctionHandle
Sourcepub fn with_read_aborted<RT, F>(&self, f: F) -> RT
pub fn with_read_aborted<RT, F>(&self, f: F) -> RT
Lock aborted with read access, call f with the value of aborted, then unlock it
Sourcepub fn with_write_aborted<RT, F>(&self, f: F) -> RT
pub fn with_write_aborted<RT, F>(&self, f: F) -> RT
Lock aborted with write access, call f with the RwLockWriteGuard, then unlock it
pub fn null() -> Arc<Self>
pub fn get_raw(&self) -> napi_threadsafe_function
pub fn set_raw(&self, raw: napi_threadsafe_function)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ThreadsafeFunctionHandle
impl RefUnwindSafe for ThreadsafeFunctionHandle
impl Send for ThreadsafeFunctionHandle
impl Sync for ThreadsafeFunctionHandle
impl Unpin for ThreadsafeFunctionHandle
impl UnsafeUnpin for ThreadsafeFunctionHandle
impl UnwindSafe for ThreadsafeFunctionHandle
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