pub trait WritableStringExt: Writable<Target = String> {
// Provided methods
fn push_str(&mut self, s: &str) { ... }
fn push(&mut self, c: char) { ... }
fn pop(&mut self) -> Option<char> { ... }
fn insert_str(&mut self, idx: usize, s: &str) { ... }
fn insert(&mut self, idx: usize, c: char) { ... }
fn remove(&mut self, idx: usize) -> char { ... }
fn replace_range(
&mut self,
range: impl RangeBounds<usize>,
replace_with: &str,
) { ... }
fn clear(&mut self) { ... }
fn extend(&mut self, iter: impl IntoIterator<Item = char>) { ... }
fn truncate(&mut self, len: usize) { ... }
fn split_off(&mut self, at: usize) -> String { ... }
}Available on crate feature
prelude only.Expand description
An extension trait for Writable<String> that provides some convenience methods.
Provided Methods§
Sourcefn insert_str(&mut self, idx: usize, s: &str)
fn insert_str(&mut self, idx: usize, s: &str)
Inserts a string at the given index.
Sourcefn replace_range(&mut self, range: impl RangeBounds<usize>, replace_with: &str)
fn replace_range(&mut self, range: impl RangeBounds<usize>, replace_with: &str)
Replace a range of the string with the given string.
Sourcefn extend(&mut self, iter: impl IntoIterator<Item = char>)
fn extend(&mut self, iter: impl IntoIterator<Item = char>)
Extends the string with the given iterator of characters.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".