pub enum HedgeError<E> {
PrimaryFastError(E),
PrimaryError(E),
BackupError(E),
Cancelled(CancelReason),
Panicked(PanicPayload),
}Expand description
Error type for hedge operations.
When a hedge fails (winner has an error/cancel/panic), this type indicates which branch won and why it failed.
Variants§
PrimaryFastError(E)
Primary completed fast with an error.
PrimaryError(E)
Primary won the race with an error.
BackupError(E)
Backup won the race with an error.
Cancelled(CancelReason)
The winner was cancelled.
Panicked(PanicPayload)
The winner panicked.
Trait Implementations§
Source§impl<E: Clone> Clone for HedgeError<E>
impl<E: Clone> Clone for HedgeError<E>
Source§fn clone(&self) -> HedgeError<E>
fn clone(&self) -> HedgeError<E>
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<E: Debug> Debug for HedgeError<E>
impl<E: Debug> Debug for HedgeError<E>
Source§impl<E: Display> Display for HedgeError<E>
impl<E: Display> Display for HedgeError<E>
Source§impl<E: Debug + Display> Error for HedgeError<E>
impl<E: Debug + Display> Error for HedgeError<E>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl<E> Freeze for HedgeError<E>where
E: Freeze,
impl<E> RefUnwindSafe for HedgeError<E>where
E: RefUnwindSafe,
impl<E> Send for HedgeError<E>where
E: Send,
impl<E> Sync for HedgeError<E>where
E: Sync,
impl<E> Unpin for HedgeError<E>where
E: Unpin,
impl<E> UnsafeUnpin for HedgeError<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for HedgeError<E>where
E: 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: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).