extern "C" fn finalize_external<T: Send + 'static>(
    env: Env,
    // Raw pointer to a `Box<T>` stored by a `napi_external`
    data: *mut std::ffi::c_void,
    // Pointer to a Rust `fn` stored in the `hint` parameter of a `napi_external` called
    // with the contents of `data` immediately before the value is garbage collected.
    hint: *mut std::ffi::c_void,
) {
    unsafe {
        let data = Box::<T>::from_raw(data as *mut _);
        let finalizer: fn(Env, T) = std::mem::transmute(hint as *const ());

        finalizer(env, *data);
    }
}
/// `finalize_external` is invoked immediately before a `napi_external` is garbage collected
`finalize_external` is invoked immediately before a `napi_external` is garbage collected
` finalize_external ` is invoked immediately before a ` napi_external ` is garbage collected
extern "C" fn finalize_external<T: Send + 'static>(
    env: Env,
    // Raw pointer to a `Box<T>` stored by a `napi_external`
    data: *mut std::ffi::c_void,
    // Pointer to a Rust `fn` stored in the `hint` parameter of a `napi_external` called
    // with the contents of `data` immediately before the value is garbage collected.
    hint: *mut std::ffi::c_void,
) {
    unsafe {
        let data = Box::<T>::from_raw(data as *mut _);
        let finalizer: fn(Env, T) = std::mem::transmute(hint as *const ());
        finalizer(env, *data);
    }
}
extern " " fn finalize_external < T : Send + ' static > ( env : Env , // Raw pointer to a `Box<T>` stored by a `napi_external` data : * mut std :: ffi :: c_void , // Pointer to a Rust `fn` stored in the `hint` parameter of a `napi_external` called // with the contents of `data` immediately before the value is garbage collected. hint : * mut std :: ffi :: c_void , ) { unsafe { let data = Box :: < T > :: from_raw ( data as * mut _ ) ; let finalizer : fn ( Env , T ) = std :: mem :: transmute ( hint as * const ( ) ) ; finalizer ( env , * data ) ; } }
`finalize_external` is invoked immediately before a `napi_external` is garbage collected
` finalize_external ` is invoked immediately before a ` napi_external ` is garbage collected
env
Env
data
*mut std::ffi::c_void
hint
*mut std::ffi::c_void