Struct exar_net::TcpMessageStream
[−]
[src]
pub struct TcpMessageStream<T: Read + Write> { // some fields omitted }
A bidiectional TCP message stream.
It allows to send and receives TcpMessage
s to and from the TcpStream
.
Methods
impl<T: Read + Write + TryClone> TcpMessageStream<T>
[src]
fn new(stream: T) -> Result<TcpMessageStream<T>, DatabaseError>
Creates a TcpMessageStream
from a given TcpStream
,
or returns a DatabaseError
if a failure occurs.
fn recv_message(&mut self) -> Result<TcpMessage, DatabaseError>
Receives and returns a TcpMessage
from the TCP stream,
or a DatabaseError
if a failure occurs.
fn send_message(&mut self, message: TcpMessage) -> Result<(), DatabaseError>
Sends a TcpMessage
to the TCP stream,
or returns a DatabaseError
if a failure occurs.
fn messages(self) -> TcpMessages<T>
Returns an iterator over the messages received on the TCP stream.