pub trait Cursor: Send {
// Required methods
fn cursor(&self) -> Pos;
fn set_cursor(&mut self, pos: Pos);
fn byte_offset(&self, pos: Pos) -> usize;
fn pos_at_byte(&self, byte: usize) -> Pos;
}Expand description
Required Methods§
Sourcefn set_cursor(&mut self, pos: Pos)
fn set_cursor(&mut self, pos: Pos)
Move the active primary cursor.
Sourcefn byte_offset(&self, pos: Pos) -> usize
fn byte_offset(&self, pos: Pos) -> usize
Byte offset for pos. Used by regex search bridges.
Sourcefn pos_at_byte(&self, byte: usize) -> Pos
fn pos_at_byte(&self, byte: usize) -> Pos
Inverse of Self::byte_offset.