Trait cdrs::transport::CDRSTransport
source · 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;
}
Expand description
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§
sourcefn try_clone(&self) -> Result<Self>
fn try_clone(&self) -> Result<Self>
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.
sourcefn close(&mut self, close: Shutdown) -> Result<()>
fn close(&mut self, close: Shutdown) -> Result<()>
Shuts down the read, write, or both halves of this connection.