Struct openssl::ssl::NonblockingSslStream [−][src]
pub struct NonblockingSslStream<S>(_);
Deprecated
Use SslStream
with ssl_read
and ssl_write
.
Methods
impl NonblockingSslStream<TcpStream>
[src]
impl NonblockingSslStream<TcpStream>
pub fn try_clone(&self) -> Result<NonblockingSslStream<TcpStream>>
[src]
pub fn try_clone(&self) -> Result<NonblockingSslStream<TcpStream>>
impl<S> NonblockingSslStream<S>
[src]
impl<S> NonblockingSslStream<S>
ⓘImportant traits for &'a mut Rpub fn get_ref(&self) -> &S
[src]
pub fn get_ref(&self) -> &S
Returns a reference to the underlying stream.
ⓘImportant traits for &'a mut Rpub fn get_mut(&mut self) -> &mut S
[src]
pub 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.
pub fn ssl(&self) -> &Ssl
[src]
pub fn ssl(&self) -> &Ssl
Returns a reference to the Ssl.
impl<S: Read + Write> NonblockingSslStream<S>
[src]
impl<S: Read + Write> NonblockingSslStream<S>
pub fn connect<T: IntoSsl>(
ssl: T,
stream: S
) -> Result<NonblockingSslStream<S>, SslError>
[src]
pub fn connect<T: IntoSsl>(
ssl: T,
stream: S
) -> Result<NonblockingSslStream<S>, SslError>
Create a new nonblocking client ssl connection on wrapped stream
.
Note that this method will most likely not actually complete the SSL handshake because doing so requires several round trips; the handshake will be completed in subsequent read/write calls managed by your event loop.
pub fn accept<T: IntoSsl>(
ssl: T,
stream: S
) -> Result<NonblockingSslStream<S>, SslError>
[src]
pub fn accept<T: IntoSsl>(
ssl: T,
stream: S
) -> Result<NonblockingSslStream<S>, SslError>
Create a new nonblocking server ssl connection on wrapped stream
.
Note that this method will most likely not actually complete the SSL handshake because doing so requires several round trips; the handshake will be completed in subsequent read/write calls managed by your event loop.
pub fn read(&mut self, buf: &mut [u8]) -> Result<usize, NonblockingSslError>
[src]
pub fn read(&mut self, buf: &mut [u8]) -> Result<usize, NonblockingSslError>
Read bytes from the SSL stream into buf
.
Given the SSL state machine, this method may return either WantWrite
or WantRead
to indicate that your event loop should respectively wait
for write or read readiness on the underlying stream. Upon readiness,
repeat your read()
call with the same arguments each time until you
receive an Ok(count)
.
An SslError
return value, is terminal; do not re-attempt your read.
As expected of a nonblocking API, this method will never block your thread on I/O.
On a return value of Ok(count)
, count is the number of decrypted
plaintext bytes copied into the buf
slice.
pub fn write(&mut self, buf: &[u8]) -> Result<usize, NonblockingSslError>
[src]
pub fn write(&mut self, buf: &[u8]) -> Result<usize, NonblockingSslError>
Write bytes from buf
to the SSL stream.
Given the SSL state machine, this method may return either WantWrite
or WantRead
to indicate that your event loop should respectively wait
for write or read readiness on the underlying stream. Upon readiness,
repeat your write()
call with the same arguments each time until you
receive an Ok(count)
.
An SslError
return value, is terminal; do not re-attempt your write.
As expected of a nonblocking API, this method will never block your thread on I/O.
Given a return value of Ok(count)
, count is the number of plaintext bytes
from the buf
slice that were encrypted and written onto the stream.
Trait Implementations
impl<S: Clone + Read + Write> Clone for NonblockingSslStream<S>
[src]
impl<S: Clone + Read + Write> Clone for NonblockingSslStream<S>
fn clone(&self) -> Self
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<S: AsRawFd> AsRawFd for NonblockingSslStream<S>
[src]
impl<S: AsRawFd> AsRawFd for NonblockingSslStream<S>
Auto Trait Implementations
impl<S> Send for NonblockingSslStream<S> where
S: Send,
impl<S> Send for NonblockingSslStream<S> where
S: Send,
impl<S> Sync for NonblockingSslStream<S> where
S: Sync,
impl<S> Sync for NonblockingSslStream<S> where
S: Sync,