# Trait error_chain::ChainedError [−] [src]

    pub trait ChainedError: Error + Send + 'static {
        type ErrorKind;
        fn from_kind(kind: Self::ErrorKind) -> Self
        where
            Self: Sized;
        fn with_chain<E, K>(error: E, kind: K) -> Self
        where
            Self: Sized,
            E: Error + Send + 'static,
            K: Into<Self::ErrorKind>;
        fn kind(&self) -> &Self::ErrorKind;
        fn iter(&self) -> ErrorChainIter;
        fn backtrace(&self) -> Option<&Backtrace>;
        fn chain_err<F, EK>(self, error: F) -> Self
        where
            F: FnOnce() -> EK,
            EK: Into<Self::ErrorKind>;

        fn display<'a>(&'a self) -> Display<'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 where
Self: Sized,`

Constructs an error from a kind, and generates a backtrace.

### `fn with_chain<E, K>(error: E, kind: K) -> Self where
Self: Sized,
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.

### `fn iter(&self) -> ErrorChainIter`

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
F: FnOnce() -> EK,
EK: Into<Self::ErrorKind>,`

Extends the error chain with a new entry.

## Provided Methods

### `fn display<'a>(&'a self) -> Display<'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.

## Implementors

- `impl ChainedError for error_chain::example_generated::inner::Error`
- `impl ChainedError for error_chain::example_generated::Error`

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)