pub enum OrStopped<E = Error> {
Internal(E),
Stopped,
}Expand description
Represents an error in a stoppable task: either an internal / fatal error, or a task getting stopped after receiving a stop request.
The Error trait is intentionally not implemented for this enum to force users
to treat the Stopped variant with care. Depending on the application, it may not be an error.
Use the try_stoppable! macro to handle this variant by early-returning Ok(()).
Variants§
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<E> Freeze for OrStopped<E>where
E: Freeze,
impl<E> RefUnwindSafe for OrStopped<E>where
E: RefUnwindSafe,
impl<E> Send for OrStopped<E>where
E: Send,
impl<E> Sync for OrStopped<E>where
E: Sync,
impl<E> Unpin for OrStopped<E>where
E: Unpin,
impl<E> UnwindSafe for OrStopped<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