Trim

Trait Trim 

Source
pub trait Trim<'a> {
    // Required methods
    fn trim_cow(self) -> Cow<'a, str>;
    fn trim_start_cow(self) -> Cow<'a, str>;
    fn trim_end_cow(self) -> Cow<'a, str>;
    fn trim_ascii_cow(self) -> Cow<'a, str>;
    fn trim_ascii_start_cow(self) -> Cow<'a, str>;
    fn trim_ascii_end_cow(self) -> Cow<'a, str>;
}
Available on crate feature alloc only.
Expand description

To extend Cow<str> to have trim_cow, trim_start_cow, trim_end_cow, trim_ascii_cow, trim_ascii_start_cow, trim_ascii_end_cow methods.

Required Methods§

Source

fn trim_cow(self) -> Cow<'a, str>

Trims both leading and trailing Unicode whitespace characters.

Source

fn trim_start_cow(self) -> Cow<'a, str>

Trims leading (left) Unicode whitespace characters.

Source

fn trim_end_cow(self) -> Cow<'a, str>

Trims trailing (right) Unicode whitespace characters.

Source

fn trim_ascii_cow(self) -> Cow<'a, str>

Trims both leading and trailing ASCII whitespace characters.

Source

fn trim_ascii_start_cow(self) -> Cow<'a, str>

Trims leading (left) ASCII whitespace characters.

Source

fn trim_ascii_end_cow(self) -> Cow<'a, str>

Trims trailing (right) ASCII whitespace characters.

Implementations on Foreign Types§

Source§

impl<'a> Trim<'a> for Cow<'a, str>

Source§

fn trim_cow(self) -> Cow<'a, str>

Source§

fn trim_start_cow(self) -> Cow<'a, str>

Source§

fn trim_end_cow(self) -> Cow<'a, str>

Source§

fn trim_ascii_cow(self) -> Cow<'a, str>

Source§

fn trim_ascii_start_cow(self) -> Cow<'a, str>

Source§

fn trim_ascii_end_cow(self) -> Cow<'a, str>

Implementors§