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) -> Error where
E: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
pub fn new<E>(origin: Origin, kind: Kind, cause: E) -> Error where
E: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
Construct a new error given ErrorCodes and a cause.
sourcepub fn new_unknown<E>(origin: Origin, cause: E) -> Error where
E: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
pub fn new_unknown<E>(origin: Origin, cause: E) -> Error where
E: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
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) -> Error
pub fn new_without_cause(origin: Origin, kind: Kind) -> Error
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<Error, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Error, <__D as Deserializer<'de>>::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 Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl From<OckamError> for Error
impl From<OckamError> for Error
sourcefn from(err: OckamError) -> Error
fn from(err: OckamError) -> Error
Converts to this type from the input type.
sourceimpl From<RouteError> for Error
impl From<RouteError> for Error
sourcefn from(err: RouteError) -> Error
fn from(err: RouteError) -> Error
Converts to this type from the input type.
sourceimpl From<VaultError> for Error
impl From<VaultError> for Error
sourcefn from(err: VaultError) -> Error
fn from(err: VaultError) -> Error
Converts to this type from the input type.
sourceimpl Serialize for Error
impl Serialize for Error
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> Decodable for T where
T: DeserializeOwned,
impl<T> Decodable for T where
T: DeserializeOwned,
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more