pub fn is_caused_by<E: std::error::Error + 'static>(
    mut error: &(dyn std::error::Error + 'static),
) -> bool {
    loop {
        if error.is::<E>() {
            return true;
        }
        error = match error.source() {
            Some(e) => e,
            None => return false,
        };
    }
}
/// Determines whether the provided error was caused by an `E` typed error.
Determines whether the provided error was caused by an `E` typed error.
Determines whether the provided error was caused by an ` E ` typed error .
pub fn is_caused_by<E: std::error::Error + 'static>(
    mut error: &(dyn std::error::Error + 'static),
) -> bool {
    loop {
        if error.is::<E>() {
            return true;
        }
        error = match error.source() {
            Some(e) => e,
            None => return false,
        };
    }
}
pub fn is_caused_by < E : std :: error :: Error + ' static > ( mut error : & ( dyn std :: error :: Error + ' static ) , ) -> bool { loop { if error . is :: < E > ( ) { return true ; } error = match error . source ( ) { Some ( e ) => e , None => return false , } ; } }
Determines whether the provided error was caused by an `E` typed error.
Determines whether the provided error was caused by an ` E ` typed error .
error
&(dyn std::error::Error + 'static)