Expand description
The strategy used to recover from errors that a task returns.
Variants
Ignore
Propagate
Custom(Box<dyn FnOnce(&Error) -> OnError + Send + Sync>)
Implementations
sourceimpl OnError
impl OnError
sourcepub fn custom(f: impl FnOnce(&Error) -> OnError + 'static + Send + Sync) -> Self
pub fn custom(f: impl FnOnce(&Error) -> OnError + 'static + Send + Sync) -> Self
Creates an error strategy based on the given closure. Convenience wrapper over OnError::Custom
that boxes the closure for you.
Auto Trait Implementations
impl !RefUnwindSafe for OnError
impl Send for OnError
impl Sync for OnError
impl Unpin for OnError
impl !UnwindSafe for OnError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more