pub trait Free {
// Required method
unsafe fn free(ptr: NonNull<Self>);
}Expand description
Implemented for pointers which can be freed.
Required Methods§
Sourceunsafe fn free(ptr: NonNull<Self>)
unsafe fn free(ptr: NonNull<Self>)
Drops the content pointed by this pointer and frees it.
§Safety
The ptr must be allocated through malloc().
Do not call this method if the pointer has been freed. Users of this trait should maintain a
flag to track if the pointer has been freed or not (the Rust compiler will automatically do
this with a Drop type).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".