pub(crate) trait StrMutExt {
// Required methods
fn truncate_newline(&mut self) -> bool;
fn truncate_end_whitespaces(&mut self);
fn append_ellipsis(&mut self);
fn strip_nul(&mut self);
// Provided method
fn clean_string(&mut self) { ... }
}Expand description
Common extensions to mutable strings.
Required Methods§
Sourcefn truncate_newline(&mut self) -> bool
fn truncate_newline(&mut self) -> bool
Truncate this string at the first newline.
Appends an ellipsis if the string was truncated.
Returns true if the string was truncated.
Sourcefn truncate_end_whitespaces(&mut self)
fn truncate_end_whitespaces(&mut self)
Truncate whitespaces at the end of the string.
Sourcefn append_ellipsis(&mut self)
fn append_ellipsis(&mut self)
Append an ellipsis, except if this string already ends with an ellipsis.
Provided Methods§
Sourcefn clean_string(&mut self)
fn clean_string(&mut self)
Remove unnecessary or problematic characters from the string.