[][src]Struct alloc_compose::FallbackAlloc

pub struct FallbackAlloc<Primary, Fallback> {
    pub primary: Primary,
    pub fallback: Fallback,
}

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]

impl<Primary: Clone, Fallback: Clone> Clone for FallbackAlloc<Primary, Fallback>[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]

Auto Trait Implementations

impl<Primary, Fallback> Send for FallbackAlloc<Primary, Fallback> where
    Fallback: Send,
    Primary: Send

impl<Primary, Fallback> Sync for FallbackAlloc<Primary, Fallback> where
    Fallback: Sync,
    Primary: Sync

impl<Primary, Fallback> Unpin for FallbackAlloc<Primary, Fallback> where
    Fallback: Unpin,
    Primary: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.