Struct ami::HeapMem
[−]
[src]
#[repr(C)]pub struct HeapMem<T>(_);
Memory on the heap - managed by Rust.
Methods
impl<T> HeapMem<T>
[src]
fn new(size: usize) -> HeapMem<T>
[src]
Reserve size
bytes of memory and return it's address (a pointer).
fn from(x: T) -> HeapMem<T>
[src]
Allocates memory on the heap and then places x
into it.
Doesn't actually allocate if T
is zero-sized.
fn resize(&mut self, size: usize)
[src]
Resize memory at Equivalent to a call to realloc()
fn as_ptr(&self) -> *const T
[src]
Convert HeapMem
to *const T
.
fn as_mut_ptr(&self) -> *mut T
[src]
Convert HeapMem
to *mut _
.
unsafe fn as_slice(&mut self, len: usize) -> &mut [T]
[src]
Convert HeapMem
to &mut [T]
.
Trait Implementations
impl<T> Drop for HeapMem<T>
[src]
impl<T> Deref for HeapMem<T>
[src]
type Target = T
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
Dereferences the value.