[−][src]Struct alloc_compose::FallbackAlloc
An allocator equivalent of an "or" operator in algebra.
An allocation request is first attempted with the Primary
allocator. If that fails, the
request is forwarded to the Fallback
allocator. All other requests are dispatched
appropriately to one of the two allocators.
A FallbackAlloc
is useful for fast, special-purpose allocators backed up by general-purpose
allocators like Global
or System
.
Fields
primary: Primary
The primary allocator
fallback: Fallback
The fallback allocator
Trait Implementations
impl<Primary, Fallback> AllocRef for FallbackAlloc<Primary, Fallback> where
Primary: AllocRef + Owns,
Fallback: AllocRef,
[src]
Primary: AllocRef + Owns,
Fallback: AllocRef,
fn alloc(self, layout: Layout, init: AllocInit) -> Result<MemoryBlock, AllocErr>
[src]
unsafe fn dealloc(self, memory: MemoryBlock)
[src]
unsafe fn grow(
self,
memory: &mut MemoryBlock,
new_size: usize,
placement: ReallocPlacement,
init: AllocInit
) -> Result<(), AllocErr>
[src]
self,
memory: &mut MemoryBlock,
new_size: usize,
placement: ReallocPlacement,
init: AllocInit
) -> Result<(), AllocErr>
unsafe fn shrink(
self,
memory: &mut MemoryBlock,
new_size: usize,
placement: ReallocPlacement
) -> Result<(), AllocErr>
[src]
self,
memory: &mut MemoryBlock,
new_size: usize,
placement: ReallocPlacement
) -> Result<(), AllocErr>
impl<Primary: Clone, Fallback: Clone> Clone for FallbackAlloc<Primary, Fallback>
[src]
fn clone(&self) -> FallbackAlloc<Primary, Fallback>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Primary: Copy, Fallback: Copy> Copy for FallbackAlloc<Primary, Fallback>
[src]
impl<Primary: Debug, Fallback: Debug> Debug for FallbackAlloc<Primary, Fallback>
[src]
impl<Primary, Fallback> Owns for FallbackAlloc<Primary, Fallback> where
Primary: Owns,
Fallback: Owns,
[src]
Primary: Owns,
Fallback: Owns,
fn owns(&self, memory: &MemoryBlock) -> bool
[src]
Auto Trait Implementations
impl<Primary, Fallback> Send for FallbackAlloc<Primary, Fallback> where
Fallback: Send,
Primary: Send,
Fallback: Send,
Primary: Send,
impl<Primary, Fallback> Sync for FallbackAlloc<Primary, Fallback> where
Fallback: Sync,
Primary: Sync,
Fallback: Sync,
Primary: Sync,
impl<Primary, Fallback> Unpin for FallbackAlloc<Primary, Fallback> where
Fallback: Unpin,
Primary: Unpin,
Fallback: Unpin,
Primary: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,