Trait rat_widget::text::Cursor
source · pub trait Cursor: Iterator {
// Required methods
fn prev(&mut self) -> Option<Self::Item>;
fn rev_cursor(self) -> impl Cursor
where Self: Sized;
fn text_offset(&self) -> usize;
}Expand description
Trait for a cursor.
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 Cursorwhere
Self: Sized,
fn rev_cursor(self) -> impl Cursorwhere
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.