pub struct Allocation<'alloc> {
pub ptr: NonNull<u8>,
pub layout: NonZeroLayout,
pub lifetime: AllocTime<'alloc>,
}
Expand description
An allocation valid for a particular lifetime.
It is advisable to try and deallocate it before the end of the lifetime instead of leaking the allocation.
Fields§
§ptr: NonNull<u8>
A pointer to the allocated and potentially uninitialized bytes.
layout: NonZeroLayout
The allocated layout.
lifetime: AllocTime<'alloc>
The lifetime of the allocation.
Trait Implementations§
Source§impl<'alloc> Clone for Allocation<'alloc>
impl<'alloc> Clone for Allocation<'alloc>
Source§fn clone(&self) -> Allocation<'alloc>
fn clone(&self) -> Allocation<'alloc>
Returns a copy 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<'alloc> Debug for Allocation<'alloc>
impl<'alloc> Debug for Allocation<'alloc>
Source§impl<'alloc> PartialEq for Allocation<'alloc>
impl<'alloc> PartialEq for Allocation<'alloc>
impl<'alloc> Copy for Allocation<'alloc>
impl<'alloc> StructuralPartialEq for Allocation<'alloc>
Auto Trait Implementations§
impl<'alloc> Freeze for Allocation<'alloc>
impl<'alloc> RefUnwindSafe for Allocation<'alloc>
impl<'alloc> !Send for Allocation<'alloc>
impl<'alloc> !Sync for Allocation<'alloc>
impl<'alloc> Unpin for Allocation<'alloc>
impl<'alloc> UnwindSafe for Allocation<'alloc>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)