Provide access to inner I/O error during handshake

This commit is contained in:
Anthony Ramine 2021-04-06 10:04:46 +02:00
parent 00f54790fb
commit dd04ec0ef4
1 changed files with 8 additions and 0 deletions

View File

@ -292,6 +292,14 @@ impl<S> HandshakeError<S> {
_ => None, _ => None,
} }
} }
/// Returns a reference to the inner I/O error, if any.
pub fn as_io_error(&self) -> Option<&io::Error> {
match &self.0 {
ssl::HandshakeError::Failure(s) => s.error().io_error(),
_ => None,
}
}
} }
impl<S> fmt::Debug for HandshakeError<S> impl<S> fmt::Debug for HandshakeError<S>