Cursor

Trait Cursor 

Source
pub trait Cursor: Iterator {
    // Required methods
    fn prev(&mut self) -> Option<Self::Item>;
    fn text_offset(&self) -> usize;

    // Provided methods
    fn peek_next(&mut self) -> Option<Self::Item> { ... }
    fn peek_prev(&mut self) -> Option<Self::Item> { ... }
}
Expand description

Trait for a cursor (akin to an Iterator, not the blinking thing).

This is not a DoubleEndedIterator which can iterate from both ends of the iterator, but moves a cursor forward/back over the collection.

Required Methods§

Source

fn prev(&mut self) -> Option<Self::Item>

Return the previous item.

Source

fn text_offset(&self) -> usize

Offset of the current cursor position into the underlying text.

Provided Methods§

Source

fn peek_next(&mut self) -> Option<Self::Item>

Peek next.

Source

fn peek_prev(&mut self) -> Option<Self::Item>

Peek prev.

Implementors§