libnode_sys/napi/napi_8/
napi_remove_async_cleanup_hook.rs

1use std::sync::OnceLock;
2
3use super::super::*;
4
5const SYMBOL: &[u8] = "napi_remove_async_cleanup_hook".as_bytes();
6type SIGNATURE = fn(remove_handle: napi_async_cleanup_hook_handle) -> napi_status;
7static CACHE: OnceLock<crate::load::Symbol<SIGNATURE>> = OnceLock::new();
8
9pub unsafe fn napi_remove_async_cleanup_hook(
10  remove_handle: napi_async_cleanup_hook_handle
11) -> napi_status {
12  unsafe { CACHE.get_or_init(|| crate::load::get_sym(SYMBOL).unwrap())(remove_handle) }
13}