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§
Sourcefn line_count(&self) -> usize
fn line_count(&self) -> usize
Returns the number of lines in the text.
Sourcefn character(&self, idx: usize) -> Option<char>
fn character(&self, idx: usize) -> Option<char>
Returns the character at the given character index.
Sourcefn len_before_line(&self, line: usize) -> usize
fn len_before_line(&self, line: usize) -> usize
Returns the length of the text before the given line in characters.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.