#[non_exhaustive]pub struct MetricError(/* private fields */);Expand description
The error every generic-surface call returns, inside At<…>.
One word wide (the fields live behind a Box), so
At<MetricError> is two words and MetricResult<T> stays cheap on
the ? path.
Implementations§
Source§impl MetricError
impl MetricError
Sourcepub fn from_located<E>(kind: ErrorKind, detail: At<E>) -> At<Self>
pub fn from_located<E>(kind: ErrorKind, detail: At<E>) -> At<Self>
Transfer an existing native location trace into this envelope.
Sourcepub fn from_detail<E>(kind: ErrorKind, detail: E) -> Self
pub fn from_detail<E>(kind: ErrorKind, detail: E) -> Self
An error of kind wrapping the metric’s own error.
Sourcepub fn with_detail<E>(self, detail: E) -> Self
pub fn with_detail<E>(self, detail: E) -> Self
Attach the metric’s own error (boxed; reachable via source()).
Sourcepub fn with_boxed_detail(self, detail: Box<dyn Error + Send + Sync>) -> Self
pub fn with_boxed_detail(self, detail: Box<dyn Error + Send + Sync>) -> Self
Attach an already-boxed detail error.
Sourcepub fn with_metric(self, family: &'static str) -> Self
pub fn with_metric(self, family: &'static str) -> Self
Stamp the originating metric family ("fsim", "cvvdp").
Sourcepub fn with_message(self, message: impl Into<Cow<'static, str>>) -> Self
pub fn with_message(self, message: impl Into<Cow<'static, str>>) -> Self
Attach a human-readable message (shown when there is no detail).
Trait Implementations§
Source§impl AsStopReason for MetricError
impl AsStopReason for MetricError
Source§fn as_stop_reason(&self) -> Option<StopReason>
fn as_stop_reason(&self) -> Option<StopReason>
The [
StopReason] this error represents, or None for any other
failure.Source§impl Debug for MetricError
impl Debug for MetricError
Source§impl Display for MetricError
impl Display for MetricError
Source§impl Error for MetricError
impl Error for MetricError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for MetricError
impl !UnwindSafe for MetricError
impl Freeze for MetricError
impl Send for MetricError
impl Sync for MetricError
impl Unpin for MetricError
impl UnsafeUnpin for MetricError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more