pub struct YabsError(pub YabsErrorKind, _);
Expand description
The Error type.
This tuple struct is made of two elements:
- an
ErrorKind
which is used to determine the type of the error. - An internal
State
, not meant for direct use outside oferror_chain
internals, containing:- a backtrace, generated when the error is created.
- an error chain, used for the implementation of
Error::cause()
.
Tuple Fields§
§0: YabsErrorKind
The kind of the error.
Implementations§
Source§impl YabsError
impl YabsError
Sourcepub fn from_kind(kind: YabsErrorKind) -> YabsError
pub fn from_kind(kind: YabsErrorKind) -> YabsError
Constructs an error from a kind, and generates a backtrace.
Sourcepub fn with_chain<E, K>(error: E, kind: K) -> YabsError
pub fn with_chain<E, K>(error: E, kind: K) -> YabsError
Constructs a chained error from another error and a kind, and generates a backtrace.
Sourcepub fn kind(&self) -> &YabsErrorKind
pub fn kind(&self) -> &YabsErrorKind
Returns the kind of the error.
Sourcepub fn iter(&self) -> ErrorChainIter<'_>
pub fn iter(&self) -> ErrorChainIter<'_>
Iterates over the error chain.
Methods from Deref<Target = YabsErrorKind>§
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
A string describing the error kind.
Trait Implementations§
Source§impl ChainedError for YabsError
impl ChainedError for YabsError
Source§type ErrorKind = YabsErrorKind
type ErrorKind = YabsErrorKind
Associated kind type.
Source§fn from_kind(kind: Self::ErrorKind) -> Self
fn from_kind(kind: Self::ErrorKind) -> Self
Constructs an error from a kind, and generates a backtrace.
Source§fn with_chain<E, K>(error: E, kind: K) -> Self
fn with_chain<E, K>(error: E, kind: K) -> Self
Constructs a chained error from another error and a kind, and generates a backtrace.
Source§fn iter(&self) -> ErrorChainIter<'_>
fn iter(&self) -> ErrorChainIter<'_>
Iterates over the error chain.
Source§impl Error for YabsError
impl Error for YabsError
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§impl From<FromUtf8Error> for YabsError
impl From<FromUtf8Error> for YabsError
Source§fn from(e: FromUtf8Error) -> Self
fn from(e: FromUtf8Error) -> Self
Converts to this type from the input type.
Source§impl From<SetLoggerError> for YabsError
impl From<SetLoggerError> for YabsError
Source§fn from(e: SetLoggerError) -> Self
fn from(e: SetLoggerError) -> Self
Converts to this type from the input type.
Source§impl From<YabsError> for YabsErrorKind
impl From<YabsError> for YabsErrorKind
Source§impl From<YabsErrorKind> for YabsError
impl From<YabsErrorKind> for YabsError
Source§fn from(e: YabsErrorKind) -> Self
fn from(e: YabsErrorKind) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for YabsError
impl !RefUnwindSafe for YabsError
impl Send for YabsError
impl !Sync for YabsError
impl Unpin for YabsError
impl !UnwindSafe for YabsError
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