Trait dioxus_native_core::utils::cursor::Text
source · 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.