pub trait StrSliceAssertions {
// Required methods
fn is_blank(self) -> Self;
fn is_blank_ascii(self) -> Self;
fn contains(self, expected: impl AsRef<str>) -> Self;
fn does_not_contain(self, unexpected: impl AsRef<str>) -> Self;
fn starts_with(self, expected: impl AsRef<str>) -> Self;
fn does_not_start_with(self, unexpected: impl AsRef<str>) -> Self;
fn ends_with(self, expected: impl AsRef<str>) -> Self;
fn does_not_end_with(self, unexpected: impl AsRef<str>) -> Self;
}Expand description
Special assertions for &str (string slices) not covered by other general-purpose assertions,
like our PartialEqAssertions.
Required Methods§
Sourcefn is_blank(self) -> Self
fn is_blank(self) -> Self
Tests whether this string is empty or only containing whitespace characters.
‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property
White_Space.
Sourcefn is_blank_ascii(self) -> Self
fn is_blank_ascii(self) -> Self
Tests whether this string is empty or only containing ascii-whitespace characters.
fn contains(self, expected: impl AsRef<str>) -> Self
fn does_not_contain(self, unexpected: impl AsRef<str>) -> Self
fn starts_with(self, expected: impl AsRef<str>) -> Self
fn does_not_start_with(self, unexpected: impl AsRef<str>) -> Self
fn ends_with(self, expected: impl AsRef<str>) -> Self
fn does_not_end_with(self, unexpected: impl AsRef<str>) -> Self
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.