pub trait StaticSlabAllocated<L: RawLock, const SLAB_SIZE: usize, const TRACK_OBJECT_COUNT: bool = false>: Sized {
// Required method
fn get_allocator( ) -> &'static SlabAllocator<Self, L, SLAB_SIZE, TRACK_OBJECT_COUNT>;
}Expand description
Trait implemented by types that can be allocated from a static slab allocator.
Implementing this trait allows UniquePtr and RefPtr to automatically return
their memory to the global static allocator on drop.
Required Methods§
Sourcefn get_allocator() -> &'static SlabAllocator<Self, L, SLAB_SIZE, TRACK_OBJECT_COUNT>
fn get_allocator() -> &'static SlabAllocator<Self, L, SLAB_SIZE, TRACK_OBJECT_COUNT>
Returns a static reference to the global slab allocator.
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.