pub enum RecursiveError {
Root {
context: &'static str,
source: Box<Error>,
},
TransactionContext {
context: &'static str,
source: Box<Error>,
},
E2e {
context: &'static str,
source: Box<E2eIdentityError>,
},
MlsClient {
context: &'static str,
source: Box<Error>,
},
MlsConversation {
context: &'static str,
source: Box<Error>,
},
MlsCredential {
context: &'static str,
source: Box<Error>,
},
}Expand description
These errors wrap each of the module-specific errors in CoreCrypto.
The goal here is to reduce the need to redeclare each of these error types as an individual variant of a module-specific error type.
Variants§
Implementations§
Source§impl RecursiveError
impl RecursiveError
Sourcepub fn root<E: Into<Error>>(context: &'static str) -> impl FnOnce(E) -> Self
pub fn root<E: Into<Error>>(context: &'static str) -> impl FnOnce(E) -> Self
Wrap an error convertible into
crate::Error,
given the current context.
Prefer Self::context unless you are relying on the Into conversion.
Sourcepub fn transaction<E: Into<Error>>(
context: &'static str,
) -> impl FnOnce(E) -> Self
pub fn transaction<E: Into<Error>>( context: &'static str, ) -> impl FnOnce(E) -> Self
Wrap an error convertible into
crate::transaction_context::Error,
given the current context.
Prefer Self::context unless you are relying on the Into conversion.
Sourcepub fn e2e_identity<E: Into<E2eIdentityError>>(
context: &'static str,
) -> impl FnOnce(E) -> Self
pub fn e2e_identity<E: Into<E2eIdentityError>>( context: &'static str, ) -> impl FnOnce(E) -> Self
Wrap an error convertible into
wire_e2e_identity::E2eIdentityError,
given the current context.
Prefer Self::context unless you are relying on the Into conversion.
Sourcepub fn mls_client<E: Into<Error>>(
context: &'static str,
) -> impl FnOnce(E) -> Self
pub fn mls_client<E: Into<Error>>( context: &'static str, ) -> impl FnOnce(E) -> Self
Wrap an error convertible into
crate::mls::session::Error,
given the current context.
Prefer Self::context unless you are relying on the Into conversion.
Sourcepub fn mls_conversation<E: Into<Error>>(
context: &'static str,
) -> impl FnOnce(E) -> Self
pub fn mls_conversation<E: Into<Error>>( context: &'static str, ) -> impl FnOnce(E) -> Self
Wrap an error convertible into
crate::mls::conversation::Error,
given the current context.
Prefer Self::context unless you are relying on the Into conversion.
Sourcepub fn mls_credential<E: Into<Error>>(
context: &'static str,
) -> impl FnOnce(E) -> Self
pub fn mls_credential<E: Into<Error>>( context: &'static str, ) -> impl FnOnce(E) -> Self
Wrap an error convertible into
crate::mls::credential::Error,
given the current context.
Prefer Self::context unless you are relying on the Into conversion.
Source§impl RecursiveError
impl RecursiveError
Sourcepub fn context<E: ToRecursiveError>(
context: &'static str,
) -> impl FnOnce(E) -> Self
pub fn context<E: ToRecursiveError>( context: &'static str, ) -> impl FnOnce(E) -> Self
Wrap any error which RecursiveError knows how to wrap, given the current context.
The variant is selected from the error’s type, so this is usually what you want:
self.session().await.map_err(RecursiveError::context("getting mls client"))?This only accepts the module error types themselves. When you need to convert first, for
instance because you are holding a crate::TlsCodecError which several module errors
can absorb, reach for the variant-specific constructor such as
Self::mls_conversation instead.
Trait Implementations§
Source§impl Debug for RecursiveError
impl Debug for RecursiveError
Source§impl Display for RecursiveError
impl Display for RecursiveError
Source§impl Error for RecursiveError
impl Error for RecursiveError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<RecursiveError> for Error
impl From<RecursiveError> for Error
Source§fn from(source: RecursiveError) -> Self
fn from(source: RecursiveError) -> Self
Source§impl From<RecursiveError> for Error
impl From<RecursiveError> for Error
Source§fn from(source: RecursiveError) -> Self
fn from(source: RecursiveError) -> Self
Source§impl From<RecursiveError> for Error
impl From<RecursiveError> for Error
Source§fn from(source: RecursiveError) -> Self
fn from(source: RecursiveError) -> Self
Source§impl From<RecursiveError> for Error
impl From<RecursiveError> for Error
Source§fn from(source: RecursiveError) -> Self
fn from(source: RecursiveError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for RecursiveError
impl !UnwindSafe for RecursiveError
impl Freeze for RecursiveError
impl Send for RecursiveError
impl Sync for RecursiveError
impl Unpin for RecursiveError
impl UnsafeUnpin for RecursiveError
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<E> InnermostErrorMessage for Ewhere
E: Error,
impl<E> InnermostErrorMessage for Ewhere
E: Error,
Source§fn innermost_error_message(&self) -> String
fn innermost_error_message(&self) -> String
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more