[−][src]Trait generic_vec::raw::Storage
A type that can hold Ts, and potentially
reserve space for more Self::Itemss
Required methods
pub fn is_valid_storage() -> bool[src]
Returns true if the this storage can hold types T
pub fn capacity(&self) -> usize[src]
The number of elements that it is valid to write to this Storage
i.e. as_mut_ptr()..as_mut_ptr() + capacity() should be valid to write
Ts
pub fn as_ptr(&self) -> *const T[src]
Returns a pointer to the first element
pub fn as_mut_ptr(&mut self) -> *mut T[src]
Returns a mutable pointer to the first element
pub fn reserve(&mut self, new_capacity: usize)[src]
Reserves space for at least new_capacity elements
Safety
After this call successfully ends, the capacity must be at least
new_capacity
Panic/Abort
Maybe panic or abort if it is impossible to set the capacity to at
least new_capacity
pub fn try_reserve(&mut self, new_capacity: usize) -> Result<(), AllocError>[src]
Tries to reserve space for at least new_capacity elements
Returns Ok(()) on success, Err(AllocError) if it is impossible to
set the capacity to at least new_capacity
Safety
If Ok(()) is returned, the capacity must be at least new_capacity