[][src]Struct static_alloc::bump::Allocation

pub struct Allocation<'a, T = u8> {
    pub ptr: NonNull<T>,
    pub lifetime: Invariant<'a>,
    pub level: Level,
}

A successful allocation and current Level.

Fields

ptr: NonNull<T>

Pointer to the uninitialized region with specified layout.

lifetime: Invariant<'a>

The lifetime of the allocation.

level: Level

The observed amount of consumed bytes after the allocation.

Methods

impl<'alloc, T> Allocation<'alloc, T>[src]

pub unsafe fn leak(self, val: T) -> &'alloc mut T[src]

Write a value into the allocation and leak it.

Safety

Must have been allocated for a layout that fits the layout of T previously.

Usage

Consider the alternative Bump::leak to safely allocate and directly leak a value.

Trait Implementations

impl<'a, T: Clone> Clone for Allocation<'a, T>[src]

impl<'a, T: Copy> Copy for Allocation<'a, T>[src]

impl<'a, T: Debug> Debug for Allocation<'a, T>[src]

impl<'a, T: Eq> Eq for Allocation<'a, T>[src]

impl<'a, T: Ord> Ord for Allocation<'a, T>[src]

impl<'a, T: PartialEq> PartialEq<Allocation<'a, T>> for Allocation<'a, T>[src]

impl<'a, T: PartialOrd> PartialOrd<Allocation<'a, T>> for Allocation<'a, T>[src]

impl<'a, T> StructuralEq for Allocation<'a, T>[src]

impl<'a, T> StructuralPartialEq for Allocation<'a, T>[src]

Auto Trait Implementations

impl<'a, T = u8> !Send for Allocation<'a, T>

impl<'a, T = u8> !Sync for Allocation<'a, T>

impl<'a, T> Unpin for Allocation<'a, T>

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<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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.