Struct ixlist::Cursor [] [src]

pub struct Cursor<'a, T: 'a> {
    // some fields omitted
}

A cursor points to a location in a list, and you can step the cursor forward and backward.

Methods

impl<'a, T: 'a> Cursor<'a, T>

fn next(&mut self) -> Option<&mut T>

Step the cursor forward.

Returns None after the last element. After that, another call to .next() returns the first element of the list.

fn prev(&mut self) -> Option<&mut T>

Step the cursor backward.

Returns None when positioned before the first element. After that, another call to .prev() returns the last element of the list.

fn insert(&mut self, value: T)

Insert an element at the current position, e.g. before the element that would be returned by .next() in this position.

fn seek(&mut self, offset: Seek)

Trait Implementations

Derived Implementations

impl<'a, T: Debug + 'a> Debug for Cursor<'a, T> where T: Debug

fn fmt(&self, __arg_0: &mut Formatter) -> Result