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_matches_cow<P: Pattern>(self, pat: P) -> Cow<'a, str>;
fn trim_start_matches_cow<P: Pattern>(self, pat: P) -> Cow<'a, str>;
fn trim_end_matches_cow<P: Pattern>(self, pat: P) -> 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> with methods corresponding to the standard library trimming methods.
Required Methods§
Sourcefn trim_cow(self) -> Cow<'a, str>
fn trim_cow(self) -> Cow<'a, str>
Trims both leading and trailing Unicode whitespace characters.
Sourcefn trim_start_cow(self) -> Cow<'a, str>
fn trim_start_cow(self) -> Cow<'a, str>
Trims leading (left) Unicode whitespace characters.
Sourcefn trim_end_cow(self) -> Cow<'a, str>
fn trim_end_cow(self) -> Cow<'a, str>
Trims trailing (right) Unicode whitespace characters.
Sourcefn trim_matches_cow<P: Pattern>(self, pat: P) -> Cow<'a, str>
fn trim_matches_cow<P: Pattern>(self, pat: P) -> Cow<'a, str>
Trims all prefixes and suffixes that match a pattern.
Sourcefn trim_start_matches_cow<P: Pattern>(self, pat: P) -> Cow<'a, str>
fn trim_start_matches_cow<P: Pattern>(self, pat: P) -> Cow<'a, str>
Trims all prefixes that match a pattern.
Sourcefn trim_end_matches_cow<P: Pattern>(self, pat: P) -> Cow<'a, str>
fn trim_end_matches_cow<P: Pattern>(self, pat: P) -> Cow<'a, str>
Trims all suffixes that match a pattern.
Sourcefn trim_ascii_cow(self) -> Cow<'a, str>
fn trim_ascii_cow(self) -> Cow<'a, str>
Trims both leading and trailing ASCII whitespace characters.
Sourcefn trim_ascii_start_cow(self) -> Cow<'a, str>
fn trim_ascii_start_cow(self) -> Cow<'a, str>
Trims leading (left) ASCII whitespace characters.
Sourcefn trim_ascii_end_cow(self) -> Cow<'a, str>
fn trim_ascii_end_cow(self) -> Cow<'a, str>
Trims trailing (right) ASCII whitespace characters.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".