[−][src]Struct static_alloc::bump::Allocation
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]
fn clone(&self) -> Allocation<'a, T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
fn cmp(&self, other: &Allocation<'a, T>) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<'a, T: PartialEq> PartialEq<Allocation<'a, T>> for Allocation<'a, T>
[src]
fn eq(&self, other: &Allocation<'a, T>) -> bool
[src]
fn ne(&self, other: &Allocation<'a, T>) -> bool
[src]
impl<'a, T: PartialOrd> PartialOrd<Allocation<'a, T>> for Allocation<'a, T>
[src]
fn partial_cmp(&self, other: &Allocation<'a, T>) -> Option<Ordering>
[src]
fn lt(&self, other: &Allocation<'a, T>) -> bool
[src]
fn le(&self, other: &Allocation<'a, T>) -> bool
[src]
fn gt(&self, other: &Allocation<'a, T>) -> bool
[src]
fn ge(&self, other: &Allocation<'a, T>) -> bool
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,