pub trait MapToErr<T> {
// Required methods
fn map_to_internal_err(self, reason: &'static str) -> Result<T>;
fn map_to_err(
self,
code: impl ErrorInfo + Send + Sync + 'static,
) -> Result<T>;
fn map_to_err_with(
self,
code: impl ErrorInfo + Send + Sync + 'static,
reason: &'static str,
) -> Result<T>;
}
Expand description
Utility trait to map any Result<T,E>
to a Result<T, Box<Error>>
Required Methods§
Sourcefn map_to_internal_err(self, reason: &'static str) -> Result<T>
fn map_to_internal_err(self, reason: &'static str) -> Result<T>
Maps the error to an internal server error
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.