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 TcpMessages 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<TcpMessageDatabaseError>

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.

Trait Implementations

impl<T: Debug + Read + Write> Debug for TcpMessageStream<T>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<T: Read + Write + TryClone> TryClone for TcpMessageStream<T>
[src]

fn try_clone(&self) -> Result<Self, DatabaseError>