Trait bip_bencode::BListAccess
[−]
[src]
pub trait BListAccess<V> { fn get(&self, index: usize) -> Option<&V>; fn get_mut(&mut self, index: usize) -> Option<&mut V>; fn remove(&mut self, index: usize) -> Option<V>; fn insert(&mut self, index: usize, item: V); fn push(&mut self, item: V); fn len(&self) -> usize; }
Trait for working with generic list data structures.
Required Methods
fn get(&self, index: usize) -> Option<&V>
Get a list element at the given index.
fn get_mut(&mut self, index: usize) -> Option<&mut V>
Get a mutable list element at the given index.
fn remove(&mut self, index: usize) -> Option<V>
Remove a list element at the given index.
fn insert(&mut self, index: usize, item: V)
Insert a list element at the given index.
fn push(&mut self, item: V)
Push an element to the back of the list.
fn len(&self) -> usize
Get the length of the list.
Trait Implementations
impl<'a, V: 'a> Index<usize> for &'a BListAccess<V>
[src]
type Output = V
The returned type after indexing.
fn index(&self, index: usize) -> &V
[src]
Performs the indexing (container[index]
) operation.
impl<'a, V: 'a> Index<usize> for &'a mut BListAccess<V>
[src]
type Output = V
The returned type after indexing.
fn index(&self, index: usize) -> &V
[src]
Performs the indexing (container[index]
) operation.
impl<'a, V: 'a> IndexMut<usize> for &'a mut BListAccess<V>
[src]
fn index_mut(&mut self, index: usize) -> &mut V
[src]
Performs the mutable indexing (container[index]
) operation.
impl<'a, V: 'a> IntoIterator for &'a BListAccess<V>
[src]
type Item = &'a V
The type of the elements being iterated over.
type IntoIter = BListIter<'a, V>
Which kind of iterator are we turning this into?
fn into_iter(self) -> BListIter<'a, V>
[src]
Creates an iterator from a value. Read more
Implementors
impl<V> BListAccess<V> for Vec<V>