Struct composable_allocators::Or
source · [−]Tuple Fields
0: Primary
1: Fallback
Trait Implementations
sourceimpl<Primary: Composable, Fallback: Allocator> Allocator for Or<Primary, Fallback>
impl<Primary: Composable, Fallback: Allocator> Allocator for Or<Primary, Fallback>
sourcefn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
🔬 This is a nightly-only experimental API. (
allocator_api
)Attempts to allocate a block of memory. Read more
sourceunsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
🔬 This is a nightly-only experimental API. (
allocator_api
)Deallocates the memory referenced by ptr
. Read more
sourceunsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout
) -> Result<NonNull<[u8]>, AllocError>
🔬 This is a nightly-only experimental API. (
allocator_api
)Attempts to extend the memory block. Read more
sourceunsafe fn shrink(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn shrink(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout
) -> Result<NonNull<[u8]>, AllocError>
🔬 This is a nightly-only experimental API. (
allocator_api
)Attempts to shrink the memory block. Read more
sourcefn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
🔬 This is a nightly-only experimental API. (
allocator_api
)Behaves like allocate
, but also ensures that the returned memory is zero-initialized. Read more
sourceimpl<Primary: Composable, Fallback: Composable> Composable for Or<Primary, Fallback>
impl<Primary: Composable, Fallback: Composable> Composable for Or<Primary, Fallback>
Auto Trait Implementations
impl<Primary, Fallback> RefUnwindSafe for Or<Primary, Fallback> where
Fallback: RefUnwindSafe,
Primary: RefUnwindSafe,
impl<Primary, Fallback> Send for Or<Primary, Fallback> where
Fallback: Send,
Primary: Send,
impl<Primary, Fallback> Sync for Or<Primary, Fallback> where
Fallback: Sync,
Primary: Sync,
impl<Primary, Fallback> Unpin for Or<Primary, Fallback> where
Fallback: Unpin,
Primary: Unpin,
impl<Primary, Fallback> UnwindSafe for Or<Primary, Fallback> where
Fallback: UnwindSafe,
Primary: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more