pub trait ResultStandardization<T> {
// Required methods
fn standardize_err(self) -> Result<T, TrustformersError>;
fn standardize_err_with_operation(
self,
operation: &str,
) -> Result<T, TrustformersError>;
fn standardize_err_with_component(
self,
component: &str,
) -> Result<T, TrustformersError>;
fn standardize_err_with_context(
self,
operation: &str,
component: &str,
) -> Result<T, TrustformersError>;
}Expand description
Extension trait for Result types to add standardization
Required Methods§
Sourcefn standardize_err(self) -> Result<T, TrustformersError>
fn standardize_err(self) -> Result<T, TrustformersError>
Standardize any error in a Result
Sourcefn standardize_err_with_operation(
self,
operation: &str,
) -> Result<T, TrustformersError>
fn standardize_err_with_operation( self, operation: &str, ) -> Result<T, TrustformersError>
Standardize with operation context
Sourcefn standardize_err_with_component(
self,
component: &str,
) -> Result<T, TrustformersError>
fn standardize_err_with_component( self, component: &str, ) -> Result<T, TrustformersError>
Standardize with component context
Sourcefn standardize_err_with_context(
self,
operation: &str,
component: &str,
) -> Result<T, TrustformersError>
fn standardize_err_with_context( self, operation: &str, component: &str, ) -> Result<T, TrustformersError>
Standardize with full context