pub trait TextFieldBuffer {
Show 15 methods
// Required methods
fn text(&self) -> &str;
fn set_text(&mut self, text: &str);
fn selection(&self) -> TextRange;
fn set_selection(&mut self, sel: TextRange);
fn length(&self) -> usize;
fn replace(&mut self, start: usize, end: usize, text: &str);
fn insert(&mut self, index: usize, text: &str);
fn delete(&mut self, start: usize, end: usize);
fn place_cursor_before_char_at(&mut self, index: usize);
fn place_cursor_at_end(&mut self);
fn select_all(&mut self);
fn revert_all_changes(&mut self);
fn original_text(&self) -> &str;
fn original_selection(&self) -> TextRange;
fn has_selection(&self) -> bool;
}Expand description
Mutable text buffer used as the scope for InputTransformation and
OutputTransformation. Corresponds to Compose’s TextFieldBuffer.
Required Methods§
fn text(&self) -> &str
fn set_text(&mut self, text: &str)
fn selection(&self) -> TextRange
fn set_selection(&mut self, sel: TextRange)
fn length(&self) -> usize
fn replace(&mut self, start: usize, end: usize, text: &str)
fn insert(&mut self, index: usize, text: &str)
fn delete(&mut self, start: usize, end: usize)
fn place_cursor_before_char_at(&mut self, index: usize)
fn place_cursor_at_end(&mut self)
fn select_all(&mut self)
fn revert_all_changes(&mut self)
fn original_text(&self) -> &str
fn original_selection(&self) -> TextRange
fn has_selection(&self) -> bool
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".