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).
Object Safety§
This trait is not object safe.