pub trait StringOrStr<'a>:
AsRef<str>
+ From<&'a str>
+ Debug
+ Display
+ Eq
+ Hash
+ Clone
+ for<'b> PartialEq<&'b str> {
// Required methods
fn strip_prefix(self, s: &str) -> Result<Self, Self>;
fn split_n(self, n: usize) -> (Self, Self);
fn trim_ws(&mut self);
fn split_noparens<const OPEN: char, const CLOSE: char>(
&'a self,
split_char: char,
) -> impl Iterator<Item = &'a str>;
fn as_cow(&self) -> Cow<'a, str>;
}
Required Methodsยง
Sourcefn strip_prefix(self, s: &str) -> Result<Self, Self>
fn strip_prefix(self, s: &str) -> Result<Self, Self>
ยงErrors
Will return Err
if self does not start with prefix.
fn split_n(self, n: usize) -> (Self, Self)
fn trim_ws(&mut self)
fn split_noparens<const OPEN: char, const CLOSE: char>( &'a self, split_char: char, ) -> impl Iterator<Item = &'a str>
fn as_cow(&self) -> Cow<'a, str>
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.