pub struct Assertion<T> { /* private fields */ }
Implementations§
Source§impl<E: Error> Assertion<E>
impl<E: Error> Assertion<E>
Sourcepub fn match_error<T: Error + Debug>(self, error: T) -> Self
pub fn match_error<T: Error + Debug>(self, error: T) -> Self
Asserts that the error is equal to the given error
Sourcepub fn contain_message(self, expected_message: &str) -> Self
pub fn contain_message(self, expected_message: &str) -> Self
Asserts that the error message contains the given message
Source§impl<T> Assertion<T>
Specific assertions for numeric types
impl<T> Assertion<T>
Specific assertions for numeric types
Sourcepub fn be_greater_than_or_equal_to(&self, other: T) -> &Self
pub fn be_greater_than_or_equal_to(&self, other: T) -> &Self
Asserts that the value is greater than or equal to the given value
Sourcepub fn be_greater_than(&self, other: T) -> &Self
pub fn be_greater_than(&self, other: T) -> &Self
Asserts that the value is greater than the given value
Sourcepub fn be_less_than_or_equal_to(&self, other: T) -> &Self
pub fn be_less_than_or_equal_to(&self, other: T) -> &Self
Asserts that the value is less than or equal to the given value
Sourcepub fn be_less_than(&self, other: T) -> &Self
pub fn be_less_than(&self, other: T) -> &Self
Asserts that the value is less than the given value
Sourcepub fn be_positive(&self) -> &Self
pub fn be_positive(&self) -> &Self
Asserts that the value is positive
Sourcepub fn be_negative(&self) -> &Self
pub fn be_negative(&self) -> &Self
Asserts that the value is negative
Sourcepub fn be_in_range(&self, start: T, end: T) -> &Self
pub fn be_in_range(&self, start: T, end: T) -> &Self
Asserts that the value is in the given range
Sourcepub fn not_be_in_range(&self, start: T, end: T) -> &Self
pub fn not_be_in_range(&self, start: T, end: T) -> &Self
Asserts that the value is not in the given range
Source§impl<T: AsRef<str>> Assertion<T>
Specific assertions for strings
impl<T: AsRef<str>> Assertion<T>
Specific assertions for strings
Sourcepub fn not_be_empty(&self) -> &Self
pub fn not_be_empty(&self) -> &Self
Asserts that the string is not empty
Sourcepub fn start_with(&self, prefix: &str) -> &Self
pub fn start_with(&self, prefix: &str) -> &Self
Asserts that the string starts with a given prefix
Sourcepub fn contain(&self, substring: &str) -> &Self
pub fn contain(&self, substring: &str) -> &Self
Asserts that the string contains a given substring
Sourcepub fn have_length(&self, length: usize) -> &Self
pub fn have_length(&self, length: usize) -> &Self
Asserts that the string has a given length
Auto Trait Implementations§
impl<T> Freeze for Assertion<T>where
T: Freeze,
impl<T> RefUnwindSafe for Assertion<T>where
T: RefUnwindSafe,
impl<T> Send for Assertion<T>where
T: Send,
impl<T> Sync for Assertion<T>where
T: Sync,
impl<T> Unpin for Assertion<T>where
T: Unpin,
impl<T> UnwindSafe for Assertion<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more