pub trait TextBuffer {
// Required methods
fn is_secure(&self) -> bool;
fn insert_text_at_char_idx(
&mut self,
char_idx: usize,
text_to_insert: &str,
) -> usize;
fn delete_text_char_range(&mut self, char_range: Range<usize>);
fn char_len(&self) -> usize;
fn to_string(&self) -> String;
}Expand description
Buffer used by SecureTextEdit.
Implemented for String always, and for [secure_types::SecureString]
when the secure-types feature is on. Secure buffers report
TextBuffer::is_secure so the widget can avoid extra copies.
Required Methods§
Sourcefn is_secure(&self) -> bool
fn is_secure(&self) -> bool
true when the backing store should not be cloned into egui history.
Sourcefn insert_text_at_char_idx(
&mut self,
char_idx: usize,
text_to_insert: &str,
) -> usize
fn insert_text_at_char_idx( &mut self, char_idx: usize, text_to_insert: &str, ) -> usize
Insert text_to_insert at the given char index. Returns chars written.
Sourcefn delete_text_char_range(&mut self, char_range: Range<usize>)
fn delete_text_char_range(&mut self, char_range: Range<usize>)
Delete the half-open char range.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".