pub enum Error<S, E> {
Aborted(S),
LostWaiter,
App(E),
}
Expand description
Errors that can be returned by the swctx
library.
Variants§
Aborted(S)
The SetCtx
was dropped while in state ‘S’.
LostWaiter
The WaitCtx
was dropped.
This will be returned by SetCtx
if it attempts to
update the context if there’s no longer a WaitCtx
to receive the
changes.
App(E)
The SetCtx
triggered an application-defined error.
Implementations§
Source§impl<S, E> Error<S, E>
impl<S, E> Error<S, E>
Sourcepub fn into_apperr(self) -> Option<E>
pub fn into_apperr(self) -> Option<E>
Return application-specific error, if set.
If the error is not Error::App(E)
then return None
, otherwise return
Some(E).
Sourcepub fn unwrap_apperr(self) -> E
pub fn unwrap_apperr(self) -> E
Return application-specific error.
§Panics
This method will panic if the error is not Error::App(E)
.
Trait Implementations§
Source§impl<S: Debug, E> Error for Error<S, E>where
E: Error,
impl<S: Debug, E> Error for Error<S, E>where
E: Error,
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()
impl<S: Eq, E: Eq> Eq for Error<S, E>
impl<S, E> StructuralPartialEq for Error<S, E>
Auto Trait Implementations§
impl<S, E> Freeze for Error<S, E>
impl<S, E> RefUnwindSafe for Error<S, E>where
S: RefUnwindSafe,
E: RefUnwindSafe,
impl<S, E> Send for Error<S, E>
impl<S, E> Sync for Error<S, E>
impl<S, E> Unpin for Error<S, E>
impl<S, E> UnwindSafe for Error<S, E>where
S: UnwindSafe,
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