pub enum Error<S, E> {
Aborted(S),
App(E),
}
Expand description
Errors that can be returned by the swctx
library.
Variants§
Aborted(S)
The SetCtx
was dropped while in state ‘S’.
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
Trait Implementations§
source§impl<S: Debug, E: Debug> Error for Error<S, E>
impl<S: Debug, E: Debug> Error for Error<S, E>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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()
source§impl<S: PartialEq, E: PartialEq> PartialEq for Error<S, E>
impl<S: PartialEq, E: PartialEq> PartialEq for Error<S, E>
impl<S, E> StructuralPartialEq for Error<S, E>
Auto Trait Implementations§
impl<S, E> RefUnwindSafe for Error<S, E>where
E: RefUnwindSafe,
S: 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
E: UnwindSafe,
S: 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