Skip to main content

Free

Trait Free 

pub trait Free: Clone {
    // Required method
    unsafe fn free(&mut self);
}
Expand description

Custom code to free a resource.

This is similar to the Drop trait, and may be used to implement Drop, but allows resources to be freed depending on context.

Required Methods§

unsafe fn free(&mut self)

Calls the resource’s free function.

§Safety

The resource must be owned by the caller and safe to free.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§