pub trait PrettyUnwrap {
type Inner;
// Required methods
fn pretty_unwrap(self) -> Self::Inner;
fn pretty_expect<S: ToString>(self, context: S) -> Self::Inner;
}Expand description
A trait to provide a nicer way to unwarp anyhow::Result.
Required Associated Types§
Required Methods§
Sourcefn pretty_unwrap(self) -> Self::Inner
fn pretty_unwrap(self) -> Self::Inner
Behaves like std::result::Result::unwrap but will print the entire anyhow chain to stderr.
Sourcefn pretty_expect<S: ToString>(self, context: S) -> Self::Inner
fn pretty_expect<S: ToString>(self, context: S) -> Self::Inner
Behaves like std::result::Result::expect but will print the entire anyhow chain to stderr.
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.
Implementations on Foreign Types§
Source§impl<T> PrettyUnwrap for Result<T>
Implement the trait for anyhow::Result.
impl<T> PrettyUnwrap for Result<T>
Implement the trait for anyhow::Result.