Struct ockam_core::errcode::ErrorCode
source · [−]Expand description
A set of abstract error codes describing an error. See the module-level documentation for details.
The fields of this struct are pub
for matching, but you need to go through
one of the constructor functions to create one of these
(and not a literal), as it is a #[non_exhaustive]
type (which may change in
the future, since it’s unclear if this provides value).
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.origin: Origin
The Origin
of this error.
kind: Kind
The Kind
of this error.
extra: i32
An additional identifying numeric payload, or 0 if none is relevant.
For example, it would be reasonable for this field to hold:
- HTTP status code
- OS
errno
/GetLastError
code - The exit status returned by a subprocess
- A numeric error code from some other system
- Et cetera.
But should generally not be used to hold non-identifying metadata, such as the date, device IDs, as that information should be stored on the payload itself.
Concretely: two ErrorCode
with different extra
values should
identify types of errors.
Implementations
Trait Implementations
sourceimpl<'de> Deserialize<'de> for ErrorCode
impl<'de> Deserialize<'de> for ErrorCode
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
sourceimpl Ord for ErrorCode
impl Ord for ErrorCode
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
sourceimpl PartialOrd<ErrorCode> for ErrorCode
impl PartialOrd<ErrorCode> for ErrorCode
sourcefn partial_cmp(&self, other: &ErrorCode) -> Option<Ordering>
fn partial_cmp(&self, other: &ErrorCode) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more