pub enum ResultChanges<OkC: ChangeReport, ErrC: ChangeReport> {
Unchanged,
BecameOk,
BecameErr,
OkInner(OkC),
ErrInner(ErrC),
}Expand description
Change report for Result<T, E> fields.
Tracks whether the result variant changed and preserves inner change information.
Variants§
Unchanged
No change occurred.
BecameOk
Variant changed from Err to Ok.
BecameErr
Variant changed from Ok to Err.
OkInner(OkC)
Both were Ok, contains the inner Ok changes.
ErrInner(ErrC)
Both were Err, contains the inner Err changes.
Implementations§
Source§impl<OkC: ChangeReport, ErrC: ChangeReport> ResultChanges<OkC, ErrC>
impl<OkC: ChangeReport, ErrC: ChangeReport> ResultChanges<OkC, ErrC>
Sourcepub fn became_err(&self) -> bool
pub fn became_err(&self) -> bool
Returns true if the result became Err (was Ok before).
Trait Implementations§
Source§impl<OkC: ChangeReport, ErrC: ChangeReport> ChangeReport for ResultChanges<OkC, ErrC>
impl<OkC: ChangeReport, ErrC: ChangeReport> ChangeReport for ResultChanges<OkC, ErrC>
Source§impl<OkC: Clone + ChangeReport, ErrC: Clone + ChangeReport> Clone for ResultChanges<OkC, ErrC>
impl<OkC: Clone + ChangeReport, ErrC: Clone + ChangeReport> Clone for ResultChanges<OkC, ErrC>
Source§fn clone(&self) -> ResultChanges<OkC, ErrC>
fn clone(&self) -> ResultChanges<OkC, ErrC>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<OkC: Debug + ChangeReport, ErrC: Debug + ChangeReport> Debug for ResultChanges<OkC, ErrC>
impl<OkC: Debug + ChangeReport, ErrC: Debug + ChangeReport> Debug for ResultChanges<OkC, ErrC>
Source§impl<OkC: ChangeReport, ErrC: ChangeReport> Default for ResultChanges<OkC, ErrC>
impl<OkC: ChangeReport, ErrC: ChangeReport> Default for ResultChanges<OkC, ErrC>
Source§fn default() -> ResultChanges<OkC, ErrC>
fn default() -> ResultChanges<OkC, ErrC>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<OkC, ErrC> Freeze for ResultChanges<OkC, ErrC>
impl<OkC, ErrC> RefUnwindSafe for ResultChanges<OkC, ErrC>where
OkC: RefUnwindSafe,
ErrC: RefUnwindSafe,
impl<OkC, ErrC> Send for ResultChanges<OkC, ErrC>
impl<OkC, ErrC> Sync for ResultChanges<OkC, ErrC>
impl<OkC, ErrC> Unpin for ResultChanges<OkC, ErrC>
impl<OkC, ErrC> UnwindSafe for ResultChanges<OkC, ErrC>where
OkC: UnwindSafe,
ErrC: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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