pub trait Cursor: Iterator {
// Required methods
fn prev(&mut self) -> Option<Self::Item>;
fn rev_cursor(self) -> impl Cursor<Item = Self::Item>
where Self: Sized;
fn text_offset(&self) -> usize;
}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§
sourcefn rev_cursor(self) -> impl Cursor<Item = Self::Item>where
Self: Sized,
fn rev_cursor(self) -> impl Cursor<Item = Self::Item>where
Self: Sized,
Return a cursor with prev/next reversed. All iterator functions work backwards.
sourcefn text_offset(&self) -> usize
fn text_offset(&self) -> usize
Offset of the current cursor position into the underlying text.