#[repr(u8)]pub enum AllocError {
AllocFailed(Layout, Cause),
InvalidLayout(InvLayout),
InvalidAlign(AlignErr),
ZeroSizedLayout(NonNull<u8>),
GrowSmallerNewLayout(usize, usize),
ShrinkLargerNewLayout(usize, usize),
ArithmeticError(ArithErr),
Other(&'static str),
}Expand description
Errors for allocator operations.
Variants§
AllocFailed(Layout, Cause)
The underlying allocator failed to allocate using the given layout; see the contained cause.
The cause may or may not be accurate depending on the type and environment.
InvalidLayout(InvLayout)
The layout computed with the given size and alignment is invalid; see the contained reason.
InvalidAlign(AlignErr)
The given alignment was invalid; see the contained information.
ZeroSizedLayout(NonNull<u8>)
The given layout was zero-sized. The contained NonNull will be dangling and valid for
the requested alignment.
This can, in many cases, be considered a success.
GrowSmallerNewLayout(usize, usize)
Attempted to grow to a smaller size.
ShrinkLargerNewLayout(usize, usize)
Attempted to shrink to a larger size.
ArithmeticError(ArithErr)
An arithmetic error.
Other(&'static str)
Any other kind of error, in the form of a string.
Trait Implementations§
Source§impl Clone for AllocError
impl Clone for AllocError
Source§fn clone(&self) -> AllocError
fn clone(&self) -> AllocError
Returns a duplicate of the value. Read more
1.0.0 · 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 AllocError
impl Debug for AllocError
Source§impl Display for AllocError
impl Display for AllocError
Source§impl PartialEq for AllocError
impl PartialEq for AllocError
impl Copy for AllocError
impl Eq for AllocError
impl StructuralPartialEq for AllocError
Auto Trait Implementations§
impl Freeze for AllocError
impl RefUnwindSafe for AllocError
impl !Send for AllocError
impl !Sync for AllocError
impl Unpin for AllocError
impl UnwindSafe for AllocError
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