napi-rs/crates/napi/src/cleanup_env.rs

10 lines
306 B
Rust
Raw Normal View History

2020-10-04 17:02:04 +09:00
pub(crate) struct CleanupEnvHookData<T: 'static> {
pub(crate) data: T,
2020-12-01 15:55:19 +09:00
pub(crate) hook: Box<dyn FnOnce(T)>,
2020-10-04 17:02:04 +09:00
}
2020-12-03 18:17:40 +09:00
/// Created by `Env::add_env_cleanup_hook`
/// And used by `Env::remove_env_cleanup_hook`
#[derive(Clone, Copy)]
2020-10-04 17:02:04 +09:00
pub struct CleanupEnvHook<T: 'static>(pub(crate) *mut CleanupEnvHookData<T>);