pub fn on_error<E>(self) -> Layer<A, B>
    where
        E: std::error::Error + 'static,
    {
        self.with_predicate(|e| e.is::<E>() || e.source().map(|s| s.is::<E>()).unwrap_or(false))
    }
/// Returns a `Layer` that falls back if the error or its source is of
/// type `E`.
Returns a `Layer` that falls back if the error or its source is of
type `E`.
Returns a ` Layer ` that falls back if the error or its source is of type ` E ` .
pub fn on_error<E>(self) -> Layer<A, B>
    where
        E: std::error::Error + 'static,
    {
        self.with_predicate(|e| e.is::<E>() || e.source().map(|s| s.is::<E>()).unwrap_or(false))
    }
pub fn on_error < E > ( self ) -> Layer < A , B > where E : std :: error :: Error + ' static , { self . with_predicate ( | e | e . is :: < E > ( ) || e . source ( ) . map ( | s | s . is :: < E > ( ) ) . unwrap_or ( false ) ) }
Returns a `Layer` that falls back if the error or its source is of
type `E`.
Returns a ` Layer ` that falls back if the error or its source is of type ` E ` .
self
self