Struct containers::collections::RawVec
[−]
[src]
pub struct RawVec<T, A: Alloc = NullAllocator> { /* fields omitted */ }
Raw growable array
Methods
impl<T, A: Alloc> RawVec<T, A>
[src]
fn new_in(a: A) -> Self
[src]
Make a new array.
fn with_capacity_in(a: A, cap: usize) -> Option<Self>
[src]
Make a new array with enough room to hold at least cap
elements.
Failures
Returns None
if allocation fails.
fn capacity(&self) -> usize
[src]
Return number of elements array can hold before reallocation.
unsafe fn storage_mut(&mut self) -> &mut [T]
[src]
unsafe fn storage(&self) -> &[T]
[src]
fn ptr(&self) -> *mut T
[src]
fn reserve(&mut self, n: usize, n_more: usize) -> bool
[src]
Make sure the array has enough room for at least n_more
more elements, assuming it
already holds n
, reallocating if need be.
Failures
Returns false
if allocation fails, true
otherwise.
fn relinquish(&mut self, n: usize) -> bool
[src]
Relinquish memory so capacity = n
.
fn grow(&mut self, cap: usize) -> bool
[src]
unsafe fn from_raw_parts_in(alloc: A, ptr: *mut T, cap: usize) -> Self
[src]
impl<T, A: Alloc + Default> RawVec<T, A>
[src]
fn new() -> Self
[src]
Make a new array.