Trait error_chain_compat_011::ChainedError [−][src]
pub trait ChainedError: 'static + Error + Send { type ErrorKind; fn from_kind(kind: Self::ErrorKind) -> Self; fn with_chain<E, K>(error: E, kind: K) -> Self
where
E: Error + Send + 'static,
K: Into<Self::ErrorKind>; fn kind(&self) -> &Self::ErrorKind; fn iter(&self) -> Iter; fn backtrace(&self) -> Option<&Backtrace>; fn chain_err<F, EK>(self, error: F) -> Self
where
EK: Into<Self::ErrorKind>,
F: FnOnce() -> EK; fn display_chain(&'a self) -> DisplayChain<'a, Self> { ... } }
This trait is implemented on all the errors generated by the error_chain
macro.
Associated Types
type ErrorKind
Associated kind type.
Required Methods
fn from_kind(kind: Self::ErrorKind) -> Self
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>,
E: Error + Send + 'static,
K: Into<Self::ErrorKind>,
Constructs a chained error from another error and a kind, and generates a backtrace.
fn kind(&self) -> &Self::ErrorKind
Returns the kind of the error.
ⓘImportant traits for Iter<'a>
fn iter(&self) -> Iter
Iterates over the error chain.
fn backtrace(&self) -> Option<&Backtrace>
Returns the backtrace associated with this error.
fn chain_err<F, EK>(self, error: F) -> Self where
EK: Into<Self::ErrorKind>,
F: FnOnce() -> EK,
EK: Into<Self::ErrorKind>,
F: FnOnce() -> EK,
Extends the error chain with a new entry.
Provided Methods
fn display_chain(&'a self) -> DisplayChain<'a, Self>
Returns an object which implements Display
for printing the full
context of this error.
The full cause chain and backtrace, if present, will be printed.
Implementations on Foreign Types
impl ChainedError for Error
[src]
impl ChainedError for Error
type ErrorKind = ErrorKind
fn new(kind: ErrorKind, state: State) -> Error
[src]
fn new(kind: ErrorKind, state: State) -> Error
fn from_kind(kind: <Error as ChainedError>::ErrorKind) -> Error
[src]
fn from_kind(kind: <Error as ChainedError>::ErrorKind) -> Error
fn with_chain<E, K>(error: E, kind: K) -> Error where
E: Error + Send + 'static,
K: Into<<Error as ChainedError>::ErrorKind>,
[src]
fn with_chain<E, K>(error: E, kind: K) -> Error where
E: Error + Send + 'static,
K: Into<<Error as ChainedError>::ErrorKind>,
fn kind(&self) -> &<Error as ChainedError>::ErrorKind
[src]
fn kind(&self) -> &<Error as ChainedError>::ErrorKind
ⓘImportant traits for Iter<'a>fn iter(&self) -> Iter
[src]
ⓘImportant traits for Iter<'a>
fn iter(&self) -> Iter
fn chain_err<F, EK>(self, error: F) -> Error where
EK: Into<ErrorKind>,
F: FnOnce() -> EK,
[src]
fn chain_err<F, EK>(self, error: F) -> Error where
EK: Into<ErrorKind>,
F: FnOnce() -> EK,
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn backtrace(&self) -> Option<&Backtrace>
fn extract_backtrace(e: &(Error + 'static + Send)) -> Option<Arc<Backtrace>>
[src]
fn extract_backtrace(e: &(Error + 'static + Send)) -> Option<Arc<Backtrace>>
fn display_chain(&'a self) -> DisplayChain<'a, Self>
[src]
fn display_chain(&'a self) -> DisplayChain<'a, Self>
impl ChainedError for Error
[src]
impl ChainedError for Error
type ErrorKind = ErrorKind
fn new(kind: ErrorKind, state: State) -> Error
[src]
fn new(kind: ErrorKind, state: State) -> Error
fn from_kind(kind: <Error as ChainedError>::ErrorKind) -> Error
[src]
fn from_kind(kind: <Error as ChainedError>::ErrorKind) -> Error
fn with_chain<E, K>(error: E, kind: K) -> Error where
E: Error + Send + 'static,
K: Into<<Error as ChainedError>::ErrorKind>,
[src]
fn with_chain<E, K>(error: E, kind: K) -> Error where
E: Error + Send + 'static,
K: Into<<Error as ChainedError>::ErrorKind>,
fn kind(&self) -> &<Error as ChainedError>::ErrorKind
[src]
fn kind(&self) -> &<Error as ChainedError>::ErrorKind
ⓘImportant traits for Iter<'a>fn iter(&self) -> Iter
[src]
ⓘImportant traits for Iter<'a>
fn iter(&self) -> Iter
fn chain_err<F, EK>(self, error: F) -> Error where
EK: Into<ErrorKind>,
F: FnOnce() -> EK,
[src]
fn chain_err<F, EK>(self, error: F) -> Error where
EK: Into<ErrorKind>,
F: FnOnce() -> EK,
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn backtrace(&self) -> Option<&Backtrace>
fn extract_backtrace(e: &(Error + 'static + Send)) -> Option<Arc<Backtrace>>
[src]
fn extract_backtrace(e: &(Error + 'static + Send)) -> Option<Arc<Backtrace>>
fn display_chain(&'a self) -> DisplayChain<'a, Self>
[src]
fn display_chain(&'a self) -> DisplayChain<'a, Self>