pub struct Allocated { /* private fields */ }Implementations§
Source§impl Allocated
impl Allocated
pub fn get_layout_for_allocation( size: usize, alignment: usize, ) -> Option<Layout>
Sourcepub unsafe fn from_layout(
pointer: *mut u8,
layout: &Layout,
capabilities: CapabilityFlags,
) -> Option<Self>
pub unsafe fn from_layout( pointer: *mut u8, layout: &Layout, capabilities: CapabilityFlags, ) -> Option<Self>
§Safety
A non-null pointer must refer to a writable allocation with the given
layout, including room for the allocation metadata.
Sourcepub unsafe fn from_user_pointer(user_pointer: *mut u8) -> Option<Self>
pub unsafe fn from_user_pointer(user_pointer: *mut u8) -> Option<Self>
§Safety
A non-null user_pointer must have been returned by get_user_pointer for
a live allocation with intact metadata.
pub fn get_layout(&self) -> Option<Layout>
pub fn get_capabilities(&self) -> CapabilityFlags
pub fn get_base_pointer(&self) -> *mut u8
pub fn get_user_pointer(&self) -> *mut u8
Auto Trait Implementations§
impl Freeze for Allocated
impl RefUnwindSafe for Allocated
impl !Send for Allocated
impl !Sync for Allocated
impl Unpin for Allocated
impl UnsafeUnpin for Allocated
impl UnwindSafe for Allocated
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