#[non_exhaustive]pub enum ScopedActivationError<E> {
Scope(ContextScopeError),
Closure(E),
}Expand description
Failure while temporarily activating a borrowed SuspendedContext.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Scope(ContextScopeError)
The temporary Context scope could not be entered or completed.
Closure(E)
The caller’s closure returned an error.
Implementations§
Source§impl<E> ScopedActivationError<E>
impl<E> ScopedActivationError<E>
Sourcepub fn map_closure<F>(self, f: impl FnOnce(E) -> F) -> ScopedActivationError<F>
pub fn map_closure<F>(self, f: impl FnOnce(E) -> F) -> ScopedActivationError<F>
Maps only the caller-provided closure error.
Sourcepub fn scope_error(&self) -> Option<ContextScopeError>
pub fn scope_error(&self) -> Option<ContextScopeError>
Returns the Context-scope failure, if the caller’s closure did not return an error.
Sourcepub fn activation_reason(&self) -> Option<ContextActivationReason>
pub fn activation_reason(&self) -> Option<ContextActivationReason>
Returns the activation rejection reason, if the closure was not entered.
Sourcepub fn closure_error(&self) -> Option<&E>
pub fn closure_error(&self) -> Option<&E>
Returns the caller-provided closure error, if one was returned.
Sourcepub fn into_closure_error(self) -> Result<E, ContextScopeError>
pub fn into_closure_error(self) -> Result<E, ContextScopeError>
Extracts the caller-provided closure error or returns the Context-scope failure.
Trait Implementations§
Source§impl<E: Debug> Debug for ScopedActivationError<E>
impl<E: Debug> Debug for ScopedActivationError<E>
Source§impl<E: Display> Display for ScopedActivationError<E>
impl<E: Display> Display for ScopedActivationError<E>
Source§impl<E> Error for ScopedActivationError<E>where
E: Error + 'static,
impl<E> Error for ScopedActivationError<E>where
E: Error + 'static,
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()
Source§impl<E> From<ContextScopeError> for ScopedActivationError<E>
impl<E> From<ContextScopeError> for ScopedActivationError<E>
Source§fn from(error: ContextScopeError) -> Self
fn from(error: ContextScopeError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<E> Freeze for ScopedActivationError<E>where
E: Freeze,
impl<E> RefUnwindSafe for ScopedActivationError<E>where
E: RefUnwindSafe,
impl<E> Send for ScopedActivationError<E>where
E: Send,
impl<E> Sync for ScopedActivationError<E>where
E: Sync,
impl<E> Unpin for ScopedActivationError<E>where
E: Unpin,
impl<E> UnsafeUnpin for ScopedActivationError<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for ScopedActivationError<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