pub struct AssertionFailure<'r, T: 'r> { /* private fields */ }Expand description
A failed assertion.
This exposes builder methods to construct the final failure message.
Implementations§
Source§impl<'r, T: DescriptiveSpec<'r>> AssertionFailure<'r, T>
impl<'r, T: DescriptiveSpec<'r>> AssertionFailure<'r, T>
Sourcepub fn from_spec(spec: &'r T) -> AssertionFailure<'r, T>
pub fn from_spec(spec: &'r T) -> AssertionFailure<'r, T>
Construct a new AssertionFailure from a DescriptiveSpec.
Sourcepub fn with_expected(&mut self, expected: String) -> &mut Self
pub fn with_expected(&mut self, expected: String) -> &mut Self
Builder method to add the expected value for the panic message.
Sourcepub fn with_actual(&mut self, actual: String) -> &mut Self
pub fn with_actual(&mut self, actual: String) -> &mut Self
Builder method to add the actual value for the panic message.
Trait Implementations§
Auto Trait Implementations§
impl<'r, T> Freeze for AssertionFailure<'r, T>
impl<'r, T> RefUnwindSafe for AssertionFailure<'r, T>where
T: RefUnwindSafe,
impl<'r, T> Send for AssertionFailure<'r, T>where
T: Sync,
impl<'r, T> Sync for AssertionFailure<'r, T>where
T: Sync,
impl<'r, T> Unpin for AssertionFailure<'r, T>
impl<'r, T> UnwindSafe for AssertionFailure<'r, T>where
T: RefUnwindSafe,
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