pub struct AssertionResult {
pub kind: AssertionKind,
pub expectation: String,
pub failure: Option<String>,
}Expand description
One assertion, evaluated.
Both strings are rendered in core rather than in the CLI so that every front-end says the same thing about the same failure, and so the wording lives next to the comparison that produced it. A front-end decides layout, colour and symbols; it does not decide what “got 404” means.
Fields§
§kind: AssertionKind§expectation: StringWhat was asserted, as a phrase: status is 200.
failure: Option<String>Why it did not hold — got 404 — or None if it did.
An Option rather than a bool plus a message, so a result cannot be
constructed claiming to have failed with nothing to say about it.
Implementations§
Trait Implementations§
Source§impl Clone for AssertionResult
impl Clone for AssertionResult
Source§fn clone(&self) -> AssertionResult
fn clone(&self) -> AssertionResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AssertionResult
impl Debug for AssertionResult
impl Eq for AssertionResult
Source§impl PartialEq for AssertionResult
impl PartialEq for AssertionResult
impl StructuralPartialEq for AssertionResult
Auto Trait Implementations§
impl Freeze for AssertionResult
impl RefUnwindSafe for AssertionResult
impl Send for AssertionResult
impl Sync for AssertionResult
impl Unpin for AssertionResult
impl UnsafeUnpin for AssertionResult
impl UnwindSafe for AssertionResult
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.