Struct error_chain::example_generated::inner::Error [−][src]
pub struct Error(pub ErrorKind, _);
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()
.
Implementations
impl Error
[src]
impl Error
[src]pub fn from_kind(kind: ErrorKind) -> Error
[src]
pub fn from_kind(kind: ErrorKind) -> Error
[src]Constructs an error from a kind, and generates a backtrace.
pub fn with_chain<E, K>(error: E, kind: K) -> Error where
E: Error + Send + 'static,
K: Into<ErrorKind>,
[src]
pub fn with_chain<E, K>(error: E, kind: K) -> Error where
E: Error + Send + 'static,
K: Into<ErrorKind>,
[src]Constructs a chained error from another error and a kind, and generates a backtrace.
pub fn with_boxed_chain<K>(error: Box<dyn Error + Send>, kind: K) -> Error where
K: Into<ErrorKind>,
[src]
pub fn with_boxed_chain<K>(error: Box<dyn Error + Send>, kind: K) -> Error where
K: Into<ErrorKind>,
[src]Construct a chained error from another boxed error and a kind, and generates a backtrace
pub fn chain_err<F, EK>(self, error: F) -> Error where
F: FnOnce() -> EK,
EK: Into<ErrorKind>,
[src]
pub fn chain_err<F, EK>(self, error: F) -> Error where
F: FnOnce() -> EK,
EK: Into<ErrorKind>,
[src]Extends the error chain with a new entry.
pub fn description(&self) -> &str
[src]
pub fn description(&self) -> &str
[src]A short description of the error.
This method is identical to Error::description()
Trait Implementations
impl ChainedError for Error
[src]
impl ChainedError for Error
[src]fn new(kind: ErrorKind, state: State) -> Error
[src]
fn from_kind(kind: Self::ErrorKind) -> Self
[src]
fn from_kind(kind: Self::ErrorKind) -> Self
[src]Constructs an error from a kind, and generates a backtrace.
fn with_chain<E, K>(error: E, kind: K) -> Self where
E: Error + Send + 'static,
K: Into<Self::ErrorKind>,
[src]
fn with_chain<E, K>(error: E, kind: K) -> Self where
E: Error + Send + 'static,
K: Into<Self::ErrorKind>,
[src]Constructs a chained error from another error and a kind, and generates a backtrace.
fn chain_err<F, EK>(self, error: F) -> Self where
F: FnOnce() -> EK,
EK: Into<ErrorKind>,
[src]
fn chain_err<F, EK>(self, error: F) -> Self where
F: FnOnce() -> EK,
EK: Into<ErrorKind>,
[src]Extends the error chain with a new entry.
fn extract_backtrace(
e: &(dyn Error + Send + 'static)
) -> Option<InternalBacktrace>
[src]
e: &(dyn Error + Send + 'static)
) -> Option<InternalBacktrace>
fn display_chain<'a>(&'a self) -> DisplayChain<'a, Self>
[src]
fn display_chain<'a>(&'a self) -> DisplayChain<'a, Self>
[src]Returns an object which implements Display
for printing the full
context of this error. Read more
impl Error for Error
[src]
impl Error for Error
[src]fn source(&self) -> Option<&(dyn Error + 'static)>
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
[src]The lower-level source of this error, if any. Read more
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
fn description(&self) -> &str
1.0.0[src]
fn description(&self) -> &str
1.0.0[src]use the Display impl or to_string()
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
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more