#[non_exhaustive]pub struct Disabled;Expand description
An allocator which cannot allocate anything.
If any operation requires allocations this will error.
Implementations§
Trait Implementations§
Source§impl Allocator for Disabled
impl Allocator for Disabled
Source§const IS_SYSTEM: bool = true
const IS_SYSTEM: bool = true
We can set this to true because the disabled allocator returns
dangling pointers which are valid in a system allocation.
Source§fn alloc<T>(self, _: T) -> Result<Self::Alloc<T>, AllocError>
fn alloc<T>(self, _: T) -> Result<Self::Alloc<T>, AllocError>
Construct an empty uninitialized raw allocation with an alignment
matching that of
T that is associated with this allocator. Read moreSource§fn alloc_empty<T>(self) -> Self::Alloc<T>
fn alloc_empty<T>(self) -> Self::Alloc<T>
Construct an empty uninitialized raw vector with an alignment matching
that of
T that is associated with this allocator. Read moreimpl Copy for Disabled
Auto Trait Implementations§
impl Freeze for Disabled
impl RefUnwindSafe for Disabled
impl Send for Disabled
impl Sync for Disabled
impl Unpin for Disabled
impl UnwindSafe for Disabled
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