pub trait ResultMetricExt<T> {
type Error;
// Required methods
fn metric_err(
self,
family: &'static str,
kind: ErrorKind,
) -> MetricResult<T>;
fn metric_err_with(
self,
family: &'static str,
classify: impl FnOnce(&Self::Error) -> ErrorKind,
) -> MetricResult<T>
where Self: Sized;
}Expand description
Convert a metric crate’s own Result into a MetricResult,
locating the error at the caller.
Required Associated Types§
Required Methods§
Sourcefn metric_err(self, family: &'static str, kind: ErrorKind) -> MetricResult<T>
fn metric_err(self, family: &'static str, kind: ErrorKind) -> MetricResult<T>
Wrap the error as the detail of a kind MetricError stamped
with family.
Sourcefn metric_err_with(
self,
family: &'static str,
classify: impl FnOnce(&Self::Error) -> ErrorKind,
) -> MetricResult<T>where
Self: Sized,
fn metric_err_with(
self,
family: &'static str,
classify: impl FnOnce(&Self::Error) -> ErrorKind,
) -> MetricResult<T>where
Self: Sized,
Like Self::metric_err, choosing the kind from the error value.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".