DropIn

Trait DropIn 

Source
pub trait DropIn {
    // Required method
    unsafe fn drop_in<A: Allocator>(&mut self, alloc: &A);
}
Expand description

Tag a structure as allocated; that is it needs to be dropped with the context of an allocator. This is equivalent to std::ops::Drop.

Required Methods§

Source

unsafe fn drop_in<A: Allocator>(&mut self, alloc: &A)

Drop elements of this container, then deallocate any memory allocated.

§Safety

alloc MUST be the allocator used to allocate self.

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<T> DropIn for Option<T>
where T: DropIn,

Source§

unsafe fn drop_in<A: Allocator>(&mut self, alloc: &A)

Implementors§

Source§

impl<Index> DropIn for AllocatedSortedVec<Index>
where Index: Ord,

Source§

impl<K: Ord, V> DropIn for AllocatedVectorMap<K, V>

Source§

impl<T> DropIn for AllocatedVec<T>