Trait fractal::utils::string::StrMutExt

source ·
pub trait StrMutExt {
    // Required methods
    fn truncate_newline(&mut self) -> bool;
    fn truncate_end_whitespaces(&mut self);
    fn append_ellipsis(&mut self);
}
Expand description

Common extensions to mutable strings.

Required Methods§

source

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.

source

fn truncate_end_whitespaces(&mut self)

Truncate whitespaces at the end of the string.

source

fn append_ellipsis(&mut self)

Append an ellipsis, except if this string already ends with an ellipsis.

Implementations on Foreign Types§

source§

impl StrMutExt for String

Implementors§