pub trait InstancedSlabAllocated<L: RawLock, const SLAB_SIZE: usize, const TRACK_OBJECT_COUNT: bool = false>: Sized {
// Required methods
fn slab_origin(
&self,
) -> Option<NonNull<SlabAllocator<Self, L, SLAB_SIZE, TRACK_OBJECT_COUNT>>>;
fn set_slab_origin(
&mut self,
origin: NonNull<SlabAllocator<Self, L, SLAB_SIZE, TRACK_OBJECT_COUNT>>,
);
}Expand description
Trait implemented by types that can be allocated from an instanced slab allocator.
Implementing this trait allows UniquePtr and RefPtr to automatically return
their memory to the originating allocator on drop.
Required Methods§
Sourcefn slab_origin(
&self,
) -> Option<NonNull<SlabAllocator<Self, L, SLAB_SIZE, TRACK_OBJECT_COUNT>>>
fn slab_origin( &self, ) -> Option<NonNull<SlabAllocator<Self, L, SLAB_SIZE, TRACK_OBJECT_COUNT>>>
Returns the address of the originating slab allocator.
Sourcefn set_slab_origin(
&mut self,
origin: NonNull<SlabAllocator<Self, L, SLAB_SIZE, TRACK_OBJECT_COUNT>>,
)
fn set_slab_origin( &mut self, origin: NonNull<SlabAllocator<Self, L, SLAB_SIZE, TRACK_OBJECT_COUNT>>, )
Sets the originating 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.