[][src]Struct anyhow::Chain

pub struct Chain<'a> { /* fields omitted */ }

Iterator of a chain of source errors.

This type is the iterator returned by Error::chain.

Example

use anyhow::Error;
use std::io;

pub fn underlying_io_error_kind(error: &Error) -> Option<io::ErrorKind> {
    for cause in error.chain() {
        if let Some(io_error) = cause.downcast_ref::<io::Error>() {
            return Some(io_error.kind());
        }
    }
    None
}

Trait Implementations

impl<'a> Iterator for Chain<'a>[src]

type Item = &'a (dyn StdError + 'static)

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a> !Send for Chain<'a>

impl<'a> Unpin for Chain<'a>

impl<'a> !Sync for Chain<'a>

impl<'a> !UnwindSafe for Chain<'a>

impl<'a> !RefUnwindSafe for Chain<'a>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]