pub trait Manager:
Sized
+ Copy
+ Debug {
type Dealloc: Dealloc;
// Required method
unsafe fn alloc(self, layout: Layout) -> *mut u8;
// Provided methods
fn new<N: Constructor>(
self,
new_in_place: N,
) -> MutRef<N::Result, Self::Dealloc> { ... }
fn fixed_new<T>(self, value: T) -> MutRef<Fixed<T>, Self::Dealloc> { ... }
fn flexible_array_new<I, E: ExactSizeIterator<Item = I>>(
self,
items: impl IntoIterator<IntoIter = E>,
) -> MutRef<FlexibleArray<I, usize>, Self::Dealloc> { ... }
}
Expand description
Block = (Header, Object)
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn new<N: Constructor>(
self,
new_in_place: N,
) -> MutRef<N::Result, Self::Dealloc>
fn new<N: Constructor>( self, new_in_place: N, ) -> MutRef<N::Result, Self::Dealloc>
Allocate a block of memory for a new T object and initialize the object with the new_in_place
.
fn fixed_new<T>(self, value: T) -> MutRef<Fixed<T>, Self::Dealloc>
fn flexible_array_new<I, E: ExactSizeIterator<Item = I>>( self, items: impl IntoIterator<IntoIter = E>, ) -> MutRef<FlexibleArray<I, usize>, Self::Dealloc>
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.