pub trait ResultExt<T> {
// Required methods
fn with_operation(
self,
operation: impl Into<String>,
) -> Result<T, TrustformersError>;
fn with_component(
self,
component: impl Into<String>,
) -> Result<T, TrustformersError>;
fn with_context_key(
self,
key: &str,
value: impl Into<String>,
) -> Result<T, TrustformersError>;
}Expand description
Extension trait for adding context to Results
Required Methods§
Sourcefn with_operation(
self,
operation: impl Into<String>,
) -> Result<T, TrustformersError>
fn with_operation( self, operation: impl Into<String>, ) -> Result<T, TrustformersError>
Add operation context to an error
Sourcefn with_component(
self,
component: impl Into<String>,
) -> Result<T, TrustformersError>
fn with_component( self, component: impl Into<String>, ) -> Result<T, TrustformersError>
Add component context to an error
Sourcefn with_context_key(
self,
key: &str,
value: impl Into<String>,
) -> Result<T, TrustformersError>
fn with_context_key( self, key: &str, value: impl Into<String>, ) -> Result<T, TrustformersError>
Add arbitrary context to an 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.