Enum dazeus::Connection
[−]
[src]
pub enum Connection { Unix(UnixStream), Tcp(TcpStream), }
A connection enum that encapsulates TCP and Unix sockets.
This enum is mainly used by the connection_from_str
method. If you want to provide your
own connection not retrieved from that function, DaZeus will work with any structure that
implements the std::io::Read
and std::io::Write
traits.
Variants
Unix | A Unix domain socket, as implemented by the |
Tcp | A TCP stream, as implemented by |
Methods
impl Connection
fn try_clone(&self) -> Result<Connection>
Try to duplicate the stream into two objects that reference the same underlying resource.
fn from_str(connection_str: &str) -> Result<Connection>
Takes a string in the format type:connection_str and tries to connect to that location. Returns the connection inside an enum that can be used inside DaZeus directly.