AllocError

Enum AllocError 

Source
#[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

Source§

fn clone(&self) -> AllocError

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AllocError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for AllocError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult

Formats the value using the given formatter. Read more
Source§

impl PartialEq for AllocError

Source§

fn eq(&self, other: &AllocError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for AllocError

Source§

impl Eq for AllocError

Source§

impl StructuralPartialEq for AllocError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnySized for T

Source§

const IS_SIZED: bool = true

Whether the type is Sized or not.
Source§

unsafe fn ptr_from_u8_ptr(p: *mut u8) -> *mut T

Creates a *mut Self from a *mut u8 data pointer. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> SizedProps for T

Source§

const SZ: usize = _

The size of the type.
Source§

const ALN: usize = _

The alignment of the type.
Source§

const LAYOUT: Layout = _

The memory layout for the type.
Source§

const IS_ZST: bool = _

Whether the type is zero-sized.
Source§

const MAX_SLICE_LEN: usize = _

The largest safe length for a [Self].
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnsizedCopy for T
where T: Copy,