pub trait CDrop {
// Required method
fn do_drop(&mut self) -> Result<(), CDropError>;
}Expand description
Releases heap memory referenced by a C-compatible value behind raw pointer
fields (typically data that was moved into a Box and leaked via
Box::into_raw).
By default, #[derive(CDrop)] emits both a
CDrop impl and a matching Drop impl that calls
do_drop, so dropping the value through Rust’s normal
path releases its pointer fields. #[no_drop_impl] suppresses only the
Drop impl; in that case a handwritten Drop must call do_drop
itself, otherwise the pointer fields are leaked.
see Deriving the traits.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".