Struct fwdlist::ListIterMut
[−]
[src]
pub struct ListIterMut<'a, T: 'a> { // some fields omitted }
Mutable iterator over a list.
Methods
impl<'a, T> ListIterMut<'a, T>
Extra operations on mutable iterator - Unstable API.
fn peek_next(&self) -> Option<&T>
Returns a reference to the next element, without moving the iterator.
fn peek_next_mut(&mut self) -> Option<&mut T>
Returns a mutable reference to the next element, without moving the iterator.
fn insert_next(&mut self, v: T)
Insert v
just after the element most recently returned by .next()
in
O(1).
The inserted element does not appear in the iteration.
fn remove_next(&mut self) -> Option<T>
Remove the element after the one most recently returned by .next()
in
O(1);
Returns the removed value or None if the iterator is already at the end of the list.
fn truncate_next(&mut self) -> List<T>
Truncate the list right after the element most recently return by
.next()
in O(1).
- returns a new list owning all the elements after the one most recently
returned by
.next()
. - the iterator is now exhausted since the list got truncated.
- returns an empty list if the iterator was already exhausted.
Trait Implementations
impl<'a, T> Into<Cursor<'a, T>> for ListIterMut<'a, T>
Convert the mutable iterator into a cursor **unstable* API*.