pub enum OutcomeRef<'a> {
Pass,
Skip(&'a AssertDetail),
Inconclusive(&'a AssertDetail),
Fail(&'a AssertDetail),
}Expand description
Borrowed view of an Outcome: same four discriminants but
the Skip, Inconclusive, and Fail payloads borrow their
AssertDetail in place. Returned by Outcome::as_ref and
the zero-clone verdict-read fast path
AssertResult::outcome_ref.
Use when the caller wants the terminal verdict shape (or its
payload) WITHOUT taking ownership — typical sites are
formatter and sidecar paths that already hold the source
AssertResult and want to avoid the per-call
AssertDetail::clone the owned Outcome accessor performs.
Variants§
Implementations§
Source§impl OutcomeRef<'_>
impl OutcomeRef<'_>
Sourcepub fn is_pass(&self) -> bool
pub fn is_pass(&self) -> bool
True iff self == OutcomeRef::Pass. Matches the boolean
shape of Outcome::is_pass for naming parity.
Sourcepub fn is_skip(&self) -> bool
pub fn is_skip(&self) -> bool
True iff self == OutcomeRef::Skip(_). Matches the
boolean shape of Outcome::is_skip.
Sourcepub fn is_fail(&self) -> bool
pub fn is_fail(&self) -> bool
True iff self == OutcomeRef::Fail(_). Matches the
boolean shape of Outcome::is_fail.
Sourcepub fn is_inconclusive(&self) -> bool
pub fn is_inconclusive(&self) -> bool
True iff self == OutcomeRef::Inconclusive(_). Matches the
boolean shape of Outcome::is_inconclusive.
Sourcepub fn to_owned(&self) -> Outcome
pub fn to_owned(&self) -> Outcome
Promote a borrowed OutcomeRef into an owned Outcome
by cloning the borrowed AssertDetail (when present).
OutcomeRef::Pass carries no payload so the conversion is
allocation-free. Pairs with Outcome::as_ref for the
borrow ↔ own round-trip; AssertResult::outcome delegates
here so the fold logic stays single-sourced in
AssertResult::outcome_ref and any future fold-rule
change (e.g. a new terminal arm) lands in one place.
Trait Implementations§
Source§impl<'a> Clone for OutcomeRef<'a>
impl<'a> Clone for OutcomeRef<'a>
Source§fn clone(&self) -> OutcomeRef<'a>
fn clone(&self) -> OutcomeRef<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for OutcomeRef<'a>
impl<'a> Debug for OutcomeRef<'a>
Source§impl<'a> PartialEq for OutcomeRef<'a>
impl<'a> PartialEq for OutcomeRef<'a>
impl<'a> Copy for OutcomeRef<'a>
impl<'a> Eq for OutcomeRef<'a>
impl<'a> StructuralPartialEq for OutcomeRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for OutcomeRef<'a>
impl<'a> RefUnwindSafe for OutcomeRef<'a>
impl<'a> Send for OutcomeRef<'a>
impl<'a> Sync for OutcomeRef<'a>
impl<'a> Unpin for OutcomeRef<'a>
impl<'a> UnwindSafe for OutcomeRef<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more