RecvStream

Trait RecvStream 

Source
pub trait RecvStream {
    // Required method
    fn recv_stream(&mut self, buf: &mut [u8]) -> Result<()>;
}
Expand description

Receiver of a stream of BBFRAMEs.

This trait is modeled around TcpStream::read_exact, since it is the main way to receive a stream of BBFRAMEs.

The BBFRAMEs cannot have padding at the end (the length of the BBFRAME must be equal to the DFL plus the BBHEADER). They need to be present back-to-back in the stream. The stream is allowed to skip supplying some complete BBFRAMEs (this may happened with a TCP stream if BBFRAMEs overflow a buffer before being written to the TCP socket).

Required Methods§

Source

fn recv_stream(&mut self, buf: &mut [u8]) -> Result<()>

Reads the exact number of bytes required to fill buf.

Implementors§

Source§

impl<R: Read> RecvStream for R