#[repr(C)]pub struct Env {
pub isolate_ptr: *mut OwnedIsolate,
pub open_handle_scopes: usize,
pub shared: *mut EnvShared,
pub async_work_sender: UnboundedSender<PendingNapiAsyncWork>,
pub threadsafe_function_sender: UnboundedSender<ThreadSafeFunctionStatus>,
pub cleanup_hooks: Rc<RefCell<Vec<(extern "C" fn(_: *const c_void), *const c_void)>>>,
pub tsfn_ref_counters: Arc<Mutex<ThreadsafeFunctionRefCounters>>,
pub last_error: napi_extended_error_info,
pub global: NonNull<Value>,
/* private fields */
}
Fields§
§isolate_ptr: *mut OwnedIsolate
§open_handle_scopes: usize
§async_work_sender: UnboundedSender<PendingNapiAsyncWork>
§threadsafe_function_sender: UnboundedSender<ThreadSafeFunctionStatus>
§cleanup_hooks: Rc<RefCell<Vec<(extern "C" fn(_: *const c_void), *const c_void)>>>
§tsfn_ref_counters: Arc<Mutex<ThreadsafeFunctionRefCounters>>
§last_error: napi_extended_error_info
§global: NonNull<Value>
Implementations§
source§impl Env
impl Env
pub fn new( isolate_ptr: *mut OwnedIsolate, context: Global<Context>, global: Global<Value>, sender: UnboundedSender<PendingNapiAsyncWork>, threadsafe_function_sender: UnboundedSender<ThreadSafeFunctionStatus>, cleanup_hooks: Rc<RefCell<Vec<(extern "C" fn(_: *const c_void), *const c_void)>>>, tsfn_ref_counters: Arc<Mutex<ThreadsafeFunctionRefCounters>> ) -> Self
pub fn add_async_work(&mut self, async_work: PendingNapiAsyncWork)
pub fn isolate(&mut self) -> &mut OwnedIsolate
pub fn scope(&self) -> CallbackScope<'_>
pub fn add_threadsafe_function_ref_counter( &mut self, id: usize, counter: Arc<AtomicUsize> )
pub fn remove_threadsafe_function_ref_counter(&mut self, id: usize)
Trait Implementations§
Auto Trait Implementations§
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