Struct veclist::VecList
[−]
[src]
pub struct VecList<T> { /* fields omitted */ }
Vec
with slots which allow to pop
values from index
which will be reused by later push
.
Methods
impl<T> VecList<T>
[src]
fn new() -> Self
[src]
Create new empty VecList
fn with_capacity(cap: usize) -> Self
[src]
Create new VecList
with specified capacity
fn push(&mut self, value: T) -> usize
[src]
Push new value into VecList
returning index
where value is placed.
fn pop(&mut self, index: usize) -> Option<T>
[src]
Pop value from specified index.
Returns None
if index is unused.
fn get(&self, index: usize) -> Option<&T>
[src]
Returns a reference to the value of given index or None
if there is no value yet.
fn get_mut(&mut self, index: usize) -> Option<&mut T>
[src]
Returns a mutable reference to the value of given index or None
if there is no value yet.
fn upper_bound(&self) -> usize
[src]
Get upper bound (exclusive) of occupied incides
Trait Implementations
impl<T: Clone> Clone for VecList<T>
[src]
fn clone(&self) -> VecList<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more