pub trait ResultExt<T>: Sealed {
// Required methods
fn context<C: Config, D>(
self,
id: C::Id,
message: impl Into<Cow<'static, str>>,
) -> Result<T, C, D>;
fn context_auto<C: Config, D>(
self,
message: impl Into<Cow<'static, str>>,
) -> Result<T, C, D>;
fn wrap_err<C: Config, D>(self, gerr: GErr<C, D>) -> Result<T, C, D>;
}Expand description
Extension for Result wrapping E as any error.
This is for general error, including GErr itself.
Passing GErr will be parsed as general error.
Required Methods§
Sourcefn context<C: Config, D>(
self,
id: C::Id,
message: impl Into<Cow<'static, str>>,
) -> Result<T, C, D>
fn context<C: Config, D>( self, id: C::Id, message: impl Into<Cow<'static, str>>, ) -> Result<T, C, D>
Wrap E inside GErr as source with manually-set id.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".