# Struct error_chain::example_generated::inner::Error [−] [src]

    pub struct Error(pub ErrorKind, _);

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 of `error_chain` internals, containing:
  - a backtrace, generated when the error is created.
  - an error chain, used for the implementation of `Error::cause()`.

## Methods

### `impl Error`
[src]

#### `fn from_kind(kind: ErrorKind) -> Error`

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

#### `fn with_chain<E, K>(error: E, kind: K) -> Error where
E: Error + Send + 'static,
K: Into<ErrorKind>,`

Constructs a chained error from another error and a kind, and generates a backtrace.

#### `fn kind(&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) -> Error where
F: FnOnce() -> EK,
EK: Into<ErrorKind>,`

Extends the error chain with a new entry.

## Methods from Deref<Target = ErrorKind>

#### `fn description(&self) -> &str`

A string describing the error kind.

## Trait Implementations

### `impl Debug for Error`
[src]

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result`

Formats the value using the given formatter.

### `impl ChainedError for Error`
[src]

#### `type ErrorKind = ErrorKind`

Associated kind type.

#### `fn new(kind: ErrorKind, state: State) -> Error`

#### `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>,`

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

Extends the error chain with a new entry.

#### `fn backtrace(&self) -> Option<&Backtrace>`

Returns the backtrace associated with this error.

#### `fn extract_backtrace(e: &(Error + Send + 'static)) -> Option<Arc<Backtrace>>`

#### `fn display<'a>(&'a self) -> Display<'a, Self>`

Returns an object which implements `Display` for printing the full context of this error. Read more

### `impl Error for Error`
[src]

#### `fn description(&self) -> &str`

A short description of the error. Read more

#### `fn cause(&self) -> Option<&Error>`

The lower-level cause of this error, if any. Read more

### `impl Display for Error`
[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`

Formats the value using the given formatter. Read more

### `impl From<ErrorKind> for Error`
[src]

#### `fn from(e: ErrorKind) -> Self`

Performs the conversion.

### `impl<'a> From<&'a str> for Error`
[src]

#### `fn from(s: &'a str) -> Self`

Performs the conversion.

### `impl From<String> for Error`
[src]

#### `fn from(s: String) -> Self`

Performs the conversion.

### `impl Deref for Error`
[src]

#### `type Target = ErrorKind`

The resulting type after dereferencing

#### `fn deref(&self) -> &Self::Target`

The method called to dereference a value

# 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`)