pub trait Text {
    // Required methods
    fn line(&self, number: usize) -> Option<&Self>;
    fn length(&self) -> usize;
    fn line_count(&self) -> usize;
    fn character(&self, idx: usize) -> Option<char>;
    fn len_before_line(&self, line: usize) -> usize;
}
Expand description

This contains the information about the text that is used by the cursor to handle navigation.

Required Methods§

source

fn line(&self, number: usize) -> Option<&Self>

Returns the line at the given index.

source

fn length(&self) -> usize

Returns the length of the text in characters.

source

fn line_count(&self) -> usize

Returns the number of lines in the text.

source

fn character(&self, idx: usize) -> Option<char>

Returns the character at the given character index.

source

fn len_before_line(&self, line: usize) -> usize

Returns the length of the text before the given line in characters.

Implementations on Foreign Types§

source§

impl Text for str

source§

fn line(&self, number: usize) -> Option<&str>

source§

fn length(&self) -> usize

source§

fn line_count(&self) -> usize

source§

fn character(&self, idx: usize) -> Option<char>

source§

fn len_before_line(&self, line: usize) -> usize

Implementors§