Trait DisposeRef

Source
pub trait DisposeRef {
    type RefTo;

    // Provided method
    unsafe fn dispose(ptr: *mut Self::RefTo) { ... }
}
Expand description

Implemented by any type of which its reference represents a C pointer that can be disposed.

Required Associated Types§

Source

type RefTo

What a reference to this type represents as a C pointer.

Provided Methods§

Source

unsafe fn dispose(ptr: *mut Self::RefTo)

Destroy the contents at the pointer’s location.

This should run some variant of libc::free(ptr)

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.

Implementations on Foreign Types§

Source§

impl DisposeRef for str

Implementors§