Add into_error

This commit is contained in:
Steven Fackler 2016-10-23 21:54:49 -07:00
parent 18dc964dc6
commit 938fdd7137
1 changed files with 5 additions and 0 deletions

View File

@ -1254,6 +1254,11 @@ impl<S> MidHandshakeSslStream<S> {
&self.error &self.error
} }
/// Consumes `self`, returning its error.
pub fn into_error(self) -> Error {
self.error
}
/// Restarts the handshake process. /// Restarts the handshake process.
pub fn handshake(mut self) -> Result<SslStream<S>, HandshakeError<S>> { pub fn handshake(mut self) -> Result<SslStream<S>, HandshakeError<S>> {
let ret = unsafe { ffi::SSL_do_handshake(self.stream.ssl.as_ptr()) }; let ret = unsafe { ffi::SSL_do_handshake(self.stream.ssl.as_ptr()) };