Struct hyper_openssl::StreamGuard
[−]
[src]
pub struct StreamGuard<'a, T: Read + Write + 'a>(_);
A guard around a locked inner SSL stream.
Methods from Deref<Target=SslStream<T>>
fn ssl_read(&mut self, buf: &mut [u8]) -> Result<usize, Error>
Like read
, but returns an ssl::Error
rather than an io::Error
.
This is particularly useful with a nonblocking socket, where the error value will identify if OpenSSL is waiting on read or write readiness.
fn ssl_write(&mut self, buf: &[u8]) -> Result<usize, Error>
Like write
, but returns an ssl::Error
rather than an io::Error
.
This is particularly useful with a nonblocking socket, where the error value will identify if OpenSSL is waiting on read or write readiness.
fn shutdown(&mut self) -> Result<ShutdownResult, Error>
Shuts down the session.
The shutdown process consists of two steps. The first step sends a
close notify message to the peer, after which ShutdownResult::Sent
is returned. The second step awaits the receipt of a close notify
message from the peer, after which ShutdownResult::Received
is
returned.
While the connection may be closed after the first step, it is recommended to fully shut the session down. In particular, it must be fully shut down if the connection is to be used for further communication in the future.
fn get_ref(&self) -> &S
Returns a reference to the underlying stream.
fn get_mut(&mut self) -> &mut S
Returns a mutable reference to the underlying stream.
Warning
It is inadvisable to read from or write to the underlying stream as it will most likely corrupt the SSL session.
fn ssl(&self) -> &SslRef
Returns the OpenSSL Ssl
object associated with this stream.
Trait Implementations
impl<'a, T: Read + Write + 'a> Deref for StreamGuard<'a, T>
[src]
type Target = SslStream<T>
The resulting type after dereferencing
fn deref(&self) -> &SslStream<T>
The method called to dereference a value