Trait egui::widgets::TextBuffer [−][src]
pub trait TextBuffer: AsRef<str> + Into<String> {
fn insert_text(&mut self, text: &str, ch_idx: usize) -> usize;
fn delete_char_range(&mut self, ch_range: Range<usize>);
fn as_str(&self) -> &str { ... }
fn clear(&mut self) { ... }
fn replace(&mut self, text: &str) { ... }
fn take(&mut self) -> String { ... }
}
Expand description
Trait constraining what types TextEdit
may use as
an underlying buffer.
Most likely you will use a String
which implements TextBuffer
.
Required methods
fn insert_text(&mut self, text: &str, ch_idx: usize) -> usize
fn insert_text(&mut self, text: &str, ch_idx: usize) -> usize
fn delete_char_range(&mut self, ch_range: Range<usize>)
fn delete_char_range(&mut self, ch_range: Range<usize>)
Deletes a range of text ch_range
from this buffer.
Notes
ch_range
is a character range, not a byte range.
Provided methods
Returns this buffer as a str
.
This is an utility method, as it simply relies on the AsRef<str>
implementation.