pub struct HeapPtr<T> { /* private fields */ }Expand description
light weight smart pointer that owns memory using HeapAlloc and HeapFree as it’s allocation and deallocation mechanisms.
Implementations§
Source§impl<T> HeapPtr<T>
impl<T> HeapPtr<T>
pub fn new(size: usize) -> Self
pub const fn from_raw(ptr: *mut T) -> Self
pub fn from_slice(slice: &[T]) -> Result<Self, AbiError>
pub const fn as_ptr(&self) -> *const T
pub const fn as_mut_ptr(&self) -> *mut T
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for HeapPtr<T>
impl<T> RefUnwindSafe for HeapPtr<T>where
T: RefUnwindSafe,
impl<T> !Send for HeapPtr<T>
impl<T> !Sync for HeapPtr<T>
impl<T> Unpin for HeapPtr<T>
impl<T> UnwindSafe for HeapPtr<T>where
T: RefUnwindSafe,
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