pub struct ExpectationChain<'a, T> { /* private fields */ }
Implementations§
Source§impl<'a, T> ExpectationChain<'a, T>
impl<'a, T> ExpectationChain<'a, T>
pub fn from_expression(expression: ExpressionUnderTest<'a, T>) -> Self
pub fn not(self) -> Self
pub fn and(self) -> Self
pub fn expecting(self, expectation: impl Expectation<T> + 'a) -> Self
pub fn failure(self, message: String) -> Self
pub fn soft(self) -> Self
pub fn conclude_result(self) -> Result<(), String>
pub fn conclude_panic(self)
Trait Implementations§
Source§impl<'a> BoolExpectationsExt<'a> for ExpectationChain<'a, bool>
impl<'a> BoolExpectationsExt<'a> for ExpectationChain<'a, bool>
Source§fn to_be_true(self) -> ExpectationChain<'a, bool>
fn to_be_true(self) -> ExpectationChain<'a, bool>
Asserts that the tested expression evaluates to true.
Source§fn to_be_false(self) -> ExpectationChain<'a, bool>
fn to_be_false(self) -> ExpectationChain<'a, bool>
Asserts that the tested expression evaluates to false.
Source§impl<'a, T> CustomFnExpectationsExt<'a, T> for ExpectationChain<'a, T>
impl<'a, T> CustomFnExpectationsExt<'a, T> for ExpectationChain<'a, T>
Source§fn to<F: 'a + FnOnce(&T) -> bool>(
self,
message: &str,
expectation_fn: F,
) -> ExpectationChain<'a, T>
fn to<F: 'a + FnOnce(&T) -> bool>( self, message: &str, expectation_fn: F, ) -> ExpectationChain<'a, T>
Asserts that the actual value satisfies some expectation, given in the form
of a custom function. This expectation function shall return false if the expectation
does not hold and true otherwise. In the former case, rassert will display the
supplied message string.
Source§impl<'a, T> EqualityExpectationsExt<'a, T> for ExpectationChain<'a, T>
impl<'a, T> EqualityExpectationsExt<'a, T> for ExpectationChain<'a, T>
Source§fn to_equal(self, expected: &'a T) -> ExpectationChain<'a, T>
fn to_equal(self, expected: &'a T) -> ExpectationChain<'a, T>
Asserts that the actual value is equal to the [expected] value. The same
as the
to_be
function.Source§fn to_be(self, expected: &'a T) -> ExpectationChain<'a, T>
fn to_be(self, expected: &'a T) -> ExpectationChain<'a, T>
Asserts that the actual value is equal to the [expected] value. The same
as the
to_equal
function.Source§fn to_not_equal(self, expected: &'a T) -> ExpectationChain<'a, T>
fn to_not_equal(self, expected: &'a T) -> ExpectationChain<'a, T>
Asserts that the actual value is not equal to the [expected] value. The same
as the
to_not_be
function.Source§fn to_not_be(self, expected: &'a T) -> ExpectationChain<'a, T>
fn to_not_be(self, expected: &'a T) -> ExpectationChain<'a, T>
Asserts that the actual value is not equal to the [expected] value. The same
as the
to_not_equal
function.Source§impl<'a, T> OptionExpectationsExt<'a, T> for ExpectationChain<'a, Option<T>>
impl<'a, T> OptionExpectationsExt<'a, T> for ExpectationChain<'a, Option<T>>
Source§fn to_be_some(self) -> ExpectationChain<'a, Option<T>>
fn to_be_some(self) -> ExpectationChain<'a, Option<T>>
Asserts that the tested Option holds
Some
value.Source§fn to_be_none(self) -> ExpectationChain<'a, Option<T>>
fn to_be_none(self) -> ExpectationChain<'a, Option<T>>
Asserts that the tested Option is
None
.Source§impl<'a, T> OptionItemExpectationsExt<'a, T> for ExpectationChain<'a, Option<T>>
impl<'a, T> OptionItemExpectationsExt<'a, T> for ExpectationChain<'a, Option<T>>
Source§fn to_contain(self, expected: &'a T) -> ExpectationChain<'a, Option<T>>
fn to_contain(self, expected: &'a T) -> ExpectationChain<'a, Option<T>>
Asserts that the actual Option holds
Some(expected)
.Source§impl<'a, T, E> ResultExpectationsExt<'a, T, E> for ExpectationChain<'a, Result<T, E>>
impl<'a, T, E> ResultExpectationsExt<'a, T, E> for ExpectationChain<'a, Result<T, E>>
Source§impl<'a, T, E> ResultOkExpectationsExt<'a, T, E> for ExpectationChain<'a, Result<T, E>>
impl<'a, T, E> ResultOkExpectationsExt<'a, T, E> for ExpectationChain<'a, Result<T, E>>
fn to_be_ok_with(self, expected: &'a T) -> ExpectationChain<'a, Result<T, E>>
Source§impl<'a, T> VectorExpectationsExt<'a, T> for ExpectationChain<'a, Vec<T>>
impl<'a, T> VectorExpectationsExt<'a, T> for ExpectationChain<'a, Vec<T>>
Source§fn to_have_length(self, expected: usize) -> ExpectationChain<'a, Vec<T>>
fn to_have_length(self, expected: usize) -> ExpectationChain<'a, Vec<T>>
Asserts that the length of the tested vector is equal to [expected].
Source§fn to_be_empty(self) -> ExpectationChain<'a, Vec<T>>
fn to_be_empty(self) -> ExpectationChain<'a, Vec<T>>
Asserts that the tested vector is empty.
Source§fn to_be_non_empty(self) -> ExpectationChain<'a, Vec<T>>
fn to_be_non_empty(self) -> ExpectationChain<'a, Vec<T>>
Asserts that the tested vector is not empty (it contains at least one item).
Source§impl<'a, T> VectorItemExpectationsExt<'a, T> for ExpectationChain<'a, Vec<T>>
impl<'a, T> VectorItemExpectationsExt<'a, T> for ExpectationChain<'a, Vec<T>>
Source§fn to_contain(self, expected: &'a T) -> ExpectationChain<'a, Vec<T>>
fn to_contain(self, expected: &'a T) -> ExpectationChain<'a, Vec<T>>
Asserts that the tested vec contains [expected].
Auto Trait Implementations§
impl<'a, T> Freeze for ExpectationChain<'a, T>
impl<'a, T> !RefUnwindSafe for ExpectationChain<'a, T>
impl<'a, T> !Send for ExpectationChain<'a, T>
impl<'a, T> !Sync for ExpectationChain<'a, T>
impl<'a, T> Unpin for ExpectationChain<'a, T>
impl<'a, T> !UnwindSafe for ExpectationChain<'a, T>
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