#[non_exhaustive]pub struct AssertionContext<'a> {
pub case: &'a TestCase,
pub capture: &'a RunCapture,
}Expand description
What an assertion sees: the test case and the run it produced.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.case: &'a TestCase§capture: &'a RunCaptureImplementations§
Source§impl<'a> AssertionContext<'a>
impl<'a> AssertionContext<'a>
pub fn new(case: &'a TestCase, capture: &'a RunCapture) -> Self
Sourcepub fn subject(&self, transform: Option<&JsonPath>) -> Option<Json>
pub fn subject(&self, transform: Option<&JsonPath>) -> Option<Json>
The value under test: the run’s RunCapture::output, or the value at
transform (resolved against RunCapture::subject_root).
Trait Implementations§
Source§impl<'a> Clone for AssertionContext<'a>
impl<'a> Clone for AssertionContext<'a>
impl<'a> Copy for AssertionContext<'a>
Auto Trait Implementations§
impl<'a> Forget for AssertionContext<'a>
impl<'a> Freeze for AssertionContext<'a>
impl<'a> Move for AssertionContext<'a>
impl<'a> RefUnwindSafe for AssertionContext<'a>
impl<'a> Send for AssertionContext<'a>
impl<'a> Sync for AssertionContext<'a>
impl<'a> Unpin for AssertionContext<'a>
impl<'a> UnsafeUnpin for AssertionContext<'a>
impl<'a> UnwindSafe for AssertionContext<'a>
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