pub fn is<E: Error + 'static>(err: &(dyn Error + 'static)) -> bool
Expand description
Returns whether the error source chain contains a given type.
ยงExample
use std::io;
let err1 = io::Error::new(io::ErrorKind::Other, "boom");
assert!(errors::is::<io::Error>(&err1));
let err2 = errors::wrap("ruh roh", err1);
assert!(errors::is::<io::Error>(&err2));