Using reqwest I do
...
let resp = self.client.head(l).send();
match resp {
Ok(s) => {
if s.status().is_informational() ||
s.status().is_success() ||
s.status().is_redirection() {
return None;
}
return Some(s.status());
},
Err(e) => { println!("{:?}", e); return None }
}
...
In a certain situation the 'e' in Err(e) is:
Error { kind: Io(Custom { kind: WouldBlock, error: StringError("timed out") }), url: Some("http://blablabla") }
Now I would like to get "timed out" ouf of it.
How do I define a match case?
I tried
Err(Error{kind:IO(Custom{kind:WouldBlock, error:e})})
which might be crap but the compiler shouts at me saying about "Error"
^^^^^ not a struct, variant or union type
It is not clear to me what to import here.