pub struct AlwaysFail;Expand description
Policy that fails every allocation.
Faulty<I, AlwaysFail> is an allocator that is permanently out of
memory — useful for exercising a caller’s OOM handling in isolation,
or as the primary of a WithFallback so that every request is
forced onto the fallback path.
Trait Implementations§
Source§impl AllocFaultPolicy for AlwaysFail
impl AllocFaultPolicy for AlwaysFail
Source§fn should_fail(&self, _layout: NonZeroLayout) -> bool
fn should_fail(&self, _layout: NonZeroLayout) -> bool
Return
true to force the pending allocation of layout to
fail with AllocError; return false to
let it proceed to the inner allocator. Read moreSource§impl Clone for AlwaysFail
impl Clone for AlwaysFail
Source§fn clone(&self) -> AlwaysFail
fn clone(&self) -> AlwaysFail
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AlwaysFail
impl Debug for AlwaysFail
Source§impl Default for AlwaysFail
impl Default for AlwaysFail
Source§fn default() -> AlwaysFail
fn default() -> AlwaysFail
Returns the “default value” for a type. Read more
impl Copy for AlwaysFail
Auto Trait Implementations§
impl Freeze for AlwaysFail
impl RefUnwindSafe for AlwaysFail
impl Send for AlwaysFail
impl Sync for AlwaysFail
impl Unpin for AlwaysFail
impl UnsafeUnpin for AlwaysFail
impl UnwindSafe for AlwaysFail
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more