pub trait AnyString {
// Required methods
fn as_str(&self) -> &str;
fn len(&self) -> usize;
fn push_str(&mut self, s: &str);
fn push(&mut self, ch: char);
fn clear(&mut self);
fn pop(&mut self) -> Option<char>;
fn truncate(&mut self, new_len: usize);
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
A trait for abstraction over different string types (Stack, Heap, Small).