pub fn cause_ref<'e, E: std::error::Error + 'static>(
    mut error: &'e (dyn std::error::Error + 'static),
) -> Option<&'e E> {
    loop {
        if let Some(e) = error.downcast_ref::<E>() {
            return Some(e);
        }
        error = error.source()?;
    }
}
/// Finds an `E` typed error in the provided error's sources.
Finds an `E` typed error in the provided error's sources.
Finds an ` E ` typed error in the provided error ' s sources .
pub fn cause_ref<'e, E: std::error::Error + 'static>(
    mut error: &'e (dyn std::error::Error + 'static),
) -> Option<&'e E> {
    loop {
        if let Some(e) = error.downcast_ref::<E>() {
            return Some(e);
        }
        error = error.source()?;
    }
}
pub fn cause_ref < ' e , E : std :: error :: Error + ' static > ( mut error : & ' e ( dyn std :: error :: Error + ' static ) , ) -> Option < & ' e E > { loop { if let Some ( e ) = error . downcast_ref :: < E > ( ) { return Some ( e ) ; } error = error . source ( ) ? ; } }
Finds an `E` typed error in the provided error's sources.
Finds an ` E ` typed error in the provided error ' s sources .
error
&'e (dyn std::error::Error + 'static)