pub trait StackableErr {
type Output;
// Required methods
fn stack(self) -> Self::Output;
fn stack_locationless(self) -> Self::Output;
fn stack_err<E: Display + Send + Sync + 'static>(self, e: E) -> Self::Output;
fn stack_err_with<E: Display + Send + Sync + 'static, F: FnOnce() -> E>(
self,
f: F,
) -> Self::Output;
fn stack_err_locationless<E: Display + Send + Sync + 'static>(
self,
e: E,
) -> Self::Output;
fn stack_err_with_locationless<E: Display + Send + Sync + 'static, F: FnOnce() -> E>(
self,
f: F,
) -> Self::Output;
fn wrap_err<D: Display + Send + Sync + 'static>(
self,
msg: D,
) -> Self::Output;
fn wrap_err_with<D: Display + Send + Sync + 'static, F: FnOnce() -> D>(
self,
msg: F,
) -> Self::Output;
fn context<D: Display + Send + Sync + 'static>(self, msg: D) -> Self::Output;
fn with_context<D: Display + Send + Sync + 'static, F: FnOnce() -> D>(
self,
msg: F,
) -> Self::Output;
}Expand description
Conversion to and addition to the stack of a stackable_error::Error.
See the main crate documentation and implementation for examples.
Required Associated Types§
Required Methods§
Sourcefn stack_locationless(self) -> Self::Output
fn stack_locationless(self) -> Self::Output
Only converts to Self::Output and pushes it on the error stack
Sourcefn stack_err<E: Display + Send + Sync + 'static>(self, e: E) -> Self::Output
fn stack_err<E: Display + Send + Sync + 'static>(self, e: E) -> Self::Output
Pushes the result of f and location information to the error stack
Sourcefn stack_err_with<E: Display + Send + Sync + 'static, F: FnOnce() -> E>(
self,
f: F,
) -> Self::Output
fn stack_err_with<E: Display + Send + Sync + 'static, F: FnOnce() -> E>( self, f: F, ) -> Self::Output
Pushes e and location information to the error stack
Sourcefn stack_err_locationless<E: Display + Send + Sync + 'static>(
self,
e: E,
) -> Self::Output
fn stack_err_locationless<E: Display + Send + Sync + 'static>( self, e: E, ) -> Self::Output
Pushes e without location information to the error stack
Sourcefn stack_err_with_locationless<E: Display + Send + Sync + 'static, F: FnOnce() -> E>(
self,
f: F,
) -> Self::Output
fn stack_err_with_locationless<E: Display + Send + Sync + 'static, F: FnOnce() -> E>( self, f: F, ) -> Self::Output
Pushes the result of f without location information to the error stack
Sourcefn wrap_err<D: Display + Send + Sync + 'static>(self, msg: D) -> Self::Output
fn wrap_err<D: Display + Send + Sync + 'static>(self, msg: D) -> Self::Output
Alternate for StackableErr::stack_err which can be used for easier
translation to and from the eyre crate
Sourcefn wrap_err_with<D: Display + Send + Sync + 'static, F: FnOnce() -> D>(
self,
msg: F,
) -> Self::Output
fn wrap_err_with<D: Display + Send + Sync + 'static, F: FnOnce() -> D>( self, msg: F, ) -> Self::Output
Alternate for StackableErr::stack_err_with which can be used for
easier translation to and from the eyre crate
Sourcefn context<D: Display + Send + Sync + 'static>(self, msg: D) -> Self::Output
fn context<D: Display + Send + Sync + 'static>(self, msg: D) -> Self::Output
Alternate for StackableErr::stack_err which can be used for easier
translation to and from the anyhow crate
Sourcefn with_context<D: Display + Send + Sync + 'static, F: FnOnce() -> D>(
self,
msg: F,
) -> Self::Output
fn with_context<D: Display + Send + Sync + 'static, F: FnOnce() -> D>( self, msg: F, ) -> Self::Output
Alternate for StackableErr::stack_err_with which can be used for
easier translation to and from the anyhow crate
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.