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

Inserts text text into this buffer at character index ch_idx.

Notes

ch_idx is a character index, not a byte index.

Return

Returns how many characters were successfully inserted

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.

Clears all characters in this buffer

Replaces all contents of this string with text

Clears all characters in this buffer and returns a string of the contents.

Implementations on Foreign Types

Implementors