[][src]Enum smolscale::OnError

pub enum OnError {
    Ignore,
    Propagate,
    Custom(Box<dyn FnOnce(&Error) -> OnError + Send + Sync>),
}

The strategy used to recover from errors that a task returns.

Variants

Ignore
Propagate
Custom(Box<dyn FnOnce(&Error) -> OnError + Send + Sync>)

Implementations

impl OnError[src]

pub fn custom(f: impl FnOnce(&Error) -> OnError + 'static + Send + Sync) -> Self[src]

Creates an error strategy based on the given closure. Convenience wrapper over OnError::Custom that boxes the closure for you.

pub fn ignore_with(f: impl FnOnce(&Error) + 'static + Send + Sync) -> Self[src]

Creates an error strategy that runs the given closure and ignores the error.

pub fn propagate_with(f: impl FnOnce(&Error) + 'static + Send + Sync) -> Self[src]

Creates an error strategy that runs the given closure and propagates it to the nursery.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.