pub trait NonBlocking {
    // Required methods
    fn nb_recv(&mut self) -> Result<Vec<Box<dyn Frame>>>;
    fn nb_send(&mut self, frame: &dyn Frame) -> Result<()>;
}
Expand description

The NonBlocking trait provides method definitions for use with non-blocking streams.

Required Methods§

source

fn nb_recv(&mut self) -> Result<Vec<Box<dyn Frame>>>

Performs a non-blocking read on the underlying stream until ErrorKind::WouldBlock or an std::io::Error has occurred.

simple_stream::Secure notes

Unlike its blocking counterpart, errors received on the OpenSSL level will be returned as ErrorKind::Other with various OpenSSL error information as strings in the description field of the std::io::Error.

source

fn nb_send(&mut self, frame: &dyn Frame) -> Result<()>

Performs a non-blocking send on the underlying stream until ErrorKind::WouldBlock or an std::io::Error has occurred.

simple_stream::Secure notes

Unlike its blocking counterpart, errors received on the OpenSSL level will be returned as ErrorKind::Other with various OpenSSL error information as strings in the description field of the std::io::Error.

Implementors§

source§

impl<S, FB> NonBlocking for Plain<S, FB>where S: Read + Write, FB: FrameBuilder,

source§

impl<S, FB> NonBlocking for Secure<S, FB>where S: Read + Write, FB: FrameBuilder,