pub enum Error {
IntConversion(TryFromIntError),
TimerError(SystemTimeError),
Message(String),
}Expand description
Low-level standard library errors wrapped into a common type for domain propagation.
This enum exists to bridge the gap between standard library error types (such as
TryFromIntError) and the domain-specific error enums in api, storage, and
model. Each domain error has an Internal(#[from] internal::Error) variant, and
the crate::wrap_internal_err! macro generates the additional From implementations
that allow the ? operator to chain through two conversions automatically.
Consumers should never match on this type directly; it is an implementation detail of the error propagation chain.
Variants§
IntConversion(TryFromIntError)
An integer type conversion overflowed or underflowed.
Typically produced when converting between usize, u64, i64, and similar
primitive integer types using TryFrom or TryInto.
TimerError(SystemTimeError)
A system time operation failed.
Produced when a SystemTime value is before the Unix epoch, which can occur
when computing elapsed durations or converting to timestamp integers.
Message(String)
A freeform error message for cases not covered by the other variants.
Used when a custom string description is the most practical way to surface an internal condition without defining a new strongly-typed variant.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<SystemTimeError> for Error
impl From<SystemTimeError> for Error
Source§fn from(source: SystemTimeError) -> Self
fn from(source: SystemTimeError) -> Self
Source§impl From<TryFromIntError> for Error
impl From<TryFromIntError> for Error
Source§fn from(source: TryFromIntError) -> Self
fn from(source: TryFromIntError) -> Self
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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
Source§impl<T> Color for Twhere
T: Display,
impl<T> Color for Twhere
T: Display,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more