pub trait AsciiExt {
// Required methods
fn split_once<F>(&self, separator: F) -> Option<(Self, Self)>
where F: FnMut(u8) -> bool,
Self: Sized;
fn trim_ascii_start(&self) -> Self;
fn trim_ascii_end(&self) -> Self;
// Provided method
fn trim_ascii(&self) -> Self
where Self: Sized { ... }
}
Expand description
ASCII extensions.
Required Methods§
Sourcefn split_once<F>(&self, separator: F) -> Option<(Self, Self)>
fn split_once<F>(&self, separator: F) -> Option<(Self, Self)>
Split the current slice once by a given separator predicate.
Sourcefn trim_ascii_start(&self) -> Self
fn trim_ascii_start(&self) -> Self
Trim ASCII whitespace from the start of the current slice.
Sourcefn trim_ascii_end(&self) -> Self
fn trim_ascii_end(&self) -> Self
Trim ASCII whitespace from the end of the current slice.
Provided Methods§
Sourcefn trim_ascii(&self) -> Selfwhere
Self: Sized,
fn trim_ascii(&self) -> Selfwhere
Self: Sized,
Trim ASCII whitespace from both ends of the current slice.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.