[][src]Struct gharial::MaybeAlloc

pub struct MaybeAlloc<A = TestAlloc<System>> where
    A: GlobalAlloc
{ /* fields omitted */ }

MaybeAlloc is an implementation for GlobalAlloc , which occasionally fails to allocate.

It is a wrapper of another GlobalAlloc , and delegates the requests to the inner, however, sometimes fails to allocate memory on purpose. i.e. MaybeAlloc::alloc can return null pointer before memory exhaustion.

The failure properbility is 1/16.

Trait Implementations

impl<A> Clone for MaybeAlloc<A> where
    A: GlobalAlloc + Clone
[src]

impl<A: Debug> Debug for MaybeAlloc<A> where
    A: GlobalAlloc
[src]

impl<A> Default for MaybeAlloc<A> where
    A: GlobalAlloc + Default
[src]

impl<A> From<A> for MaybeAlloc<A> where
    A: GlobalAlloc
[src]

impl<A> GlobalAlloc for MaybeAlloc<A> where
    A: GlobalAlloc
[src]

Auto Trait Implementations

impl<A> RefUnwindSafe for MaybeAlloc<A> where
    A: RefUnwindSafe

impl<A> Send for MaybeAlloc<A> where
    A: Send

impl<A> Sync for MaybeAlloc<A> where
    A: Sync

impl<A> Unpin for MaybeAlloc<A> where
    A: Unpin

impl<A> UnwindSafe for MaybeAlloc<A> where
    A: UnwindSafe

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<!> for T[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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]