#[non_exhaustive]pub enum Outcome {
Succeeded,
Skipped,
Cancelled,
Failed,
Abandoned,
NotRun,
}Expand description
How a phase ended. Reaching a count total is not an outcome.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Succeeded
All of the phase’s work completed.
Skipped
The planned work turned out to be unnecessary.
Cancelled
Work stopped cooperatively, after a cancellation request or timeout.
Failed
Work failed for a reason other than a stop request.
Abandoned
The phase’s owner went away without publishing an outcome.
NotRun
Prevented from running by an earlier error; earns no completed share.
Implementations§
Source§impl Outcome
impl Outcome
Sourcepub fn from_result<T, E>(
result: &Result<T, E>,
is_stop: impl FnOnce(&E) -> bool,
) -> Self
pub fn from_result<T, E>( result: &Result<T, E>, is_stop: impl FnOnce(&E) -> bool, ) -> Self
The outcome of an operation’s result: Succeeded for Ok, Cancelled
for an error is_stop accepts, and Failed for any other error.
use how_far::{Outcome, StopReason};
let stopped: Result<(), StopReason> = Err(StopReason::Cancelled);
assert_eq!(Outcome::from_result(&stopped, |_| true), Outcome::Cancelled);Trait Implementations§
impl Copy for Outcome
impl Eq for Outcome
impl StructuralPartialEq for Outcome
Auto Trait Implementations§
impl Freeze for Outcome
impl RefUnwindSafe for Outcome
impl Send for Outcome
impl Sync for Outcome
impl Unpin for Outcome
impl UnsafeUnpin for Outcome
impl UnwindSafe for Outcome
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