[][src]Trait cdrs::transport::CDRSTransport

pub trait CDRSTransport: Sized + Read + Write + Send + Sync {
    fn try_clone(&self) -> Result<Self>;
fn close(&mut self, close: Shutdown) -> Result<()>;
fn set_timeout(&mut self, dur: Option<Duration>) -> Result<()>;
fn is_alive(&self) -> bool; }

General CDRS transport trait. Both [TranportTcp][transportTcp] and [TransportTls][transportTls] has their own implementations of this trait. Generaly speaking it extends/includes io::Read and io::Write traits and should be thread safe. [transportTcp]:struct.TransportTcp.html [transportTls]:struct.TransportTls.html

Required methods

fn try_clone(&self) -> Result<Self>[src]

Creates a new independently owned handle to the underlying socket.

The returned TcpStream is a reference to the same stream that this object references. Both handles will read and write the same stream of data, and options set on one stream will be propagated to the other stream.

fn close(&mut self, close: Shutdown) -> Result<()>[src]

Shuts down the read, write, or both halves of this connection.

fn set_timeout(&mut self, dur: Option<Duration>) -> Result<()>[src]

Method which set given duration both as read and write timeout. If the value specified is None, then read() calls will block indefinitely. It is an error to pass the zero Duration to this method.

fn is_alive(&self) -> bool[src]

Method that checks that transport is alive

Loading content...

Implementors

impl CDRSTransport for TransportTcp[src]

Loading content...