Struct ockam_core::Error
source · [−]pub struct Error(_);
Expand description
The type of errors returned by Ockam functions.
Errors store:
- A set of error codes, which abstractly describe the problem and allow easily matching against specific categories of error.
- An open-ended payload, to which arbitrary data can be attached.
- The “cause”, of this error, if it has not been lost to serialization.
- Various debugging information, such as a backtrace and spantrace (which is lost over serialization).
Implementations
sourceimpl Error
impl Error
sourcepub fn new<E>(origin: Origin, kind: Kind, cause: E) -> Selfwhere
E: Into<Box<dyn Error + Send + Sync>>,
pub fn new<E>(origin: Origin, kind: Kind, cause: E) -> Selfwhere
E: Into<Box<dyn Error + Send + Sync>>,
Construct a new error given ErrorCodes and a cause.
sourcepub fn new_unknown<E>(origin: Origin, cause: E) -> Selfwhere
E: Into<Box<dyn Error + Send + Sync>>,
pub fn new_unknown<E>(origin: Origin, cause: E) -> Selfwhere
E: Into<Box<dyn Error + Send + Sync>>,
Construct a new error with “unknown” error codes.
This ideally should not be used inside Ockam.
sourcepub fn new_without_cause(origin: Origin, kind: Kind) -> Self
pub fn new_without_cause(origin: Origin, kind: Kind) -> Self
Construct a new error without an apparent cause
This constructor should be used for any error occurring because of a None unwrap.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Error
impl<'de> Deserialize<'de> for Error
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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Error for Error
impl Error for Error
sourcefn source(&self) -> Option<&(dyn ErrorTrait + 'static)>
fn source(&self) -> Option<&(dyn ErrorTrait + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
sourceimpl From<RouteError> for Error
impl From<RouteError> for Error
sourcefn from(err: RouteError) -> Self
fn from(err: RouteError) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more