Struct rust_jvm::util::one_indexed_vec::OneIndexedVec
[−]
[src]
pub struct OneIndexedVec<T> { vec: Vec<T>, }
Like a std::vec::Vec
, but 1-indexed instead of 0-indexed.
Fields
vec |
Methods
impl<T> OneIndexedVec<T>
fn get(&self, index: usize) -> Option<&T>
Returns the element of a slice at the given index, or None if the index is out of bounds.
fn len(&self) -> usize
Returns the number of elements in the slice.
fn is_empty(&self) -> bool
Returns true if the slice has a length of 0.
fn iter(&self) -> Iter<T>
Returns an iterator over the slice.
fn iter_mut(&mut self) -> IterMut<T>
Returns an iterator that allows modifying each value.