pub trait FinalizeTrait<T> {
const NON_TRIVIAL_DTOR: bool = _;
const CALLBACK: Option<extern "C" fn(*mut u8)> = _;
// Provided method
extern "C" fn finalize(obj: *mut u8) { ... }
}
Expand description
The FinalizeTrait specifies how to finalize objects.
Provided Associated Constants§
Sourceconst NON_TRIVIAL_DTOR: bool = _
const NON_TRIVIAL_DTOR: bool = _
If true finalizer is executed at the end of GC cycle for this type.
In most cases compiler should be smart enough to determine if NON_TRIVIAL_DTOR
is true
but in some rare unsafe cases you might set it to false
by yourself.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.