There is a function returning some Result<foo, Box<Error>>
. I want to recover from some of these errors, i.e. from std::io::Error
with ErrorKind::TimedOut
. I created an Example in the playground for this.
In short: I want this kind of match (or equivalent) to work with a boxed error:
match whatever {
Ok(_) => println!("Yay, OK!"),
// Err(ref e) if e.kind() == std::io::ErrorKind::TimedOut => println!("Oh noes, timeout!"),
Err(e) => println!("Unknown error: {:?}", e),
};