Trait irc::client::conn::Connection
[−]
[src]
pub trait Connection { fn send(&self, msg: &str, encoding: &str) -> Result<()>; fn recv(&self, encoding: &str) -> Result<String>; fn written(&self, encoding: &str) -> Option<String>; fn reconnect(&self) -> Result<()>; }
A connection.
Required Methods
fn send(&self, msg: &str, encoding: &str) -> Result<()>
Sends a message over this connection.
fn recv(&self, encoding: &str) -> Result<String>
Receives a single line from this connection.
fn written(&self, encoding: &str) -> Option<String>
Gets the full record of all sent messages if the Connection records this. This is intended for use in writing tests.
fn reconnect(&self) -> Result<()>
Re-establishes this connection, disconnecting from the existing case if necessary.
Implementors
impl Connection for NetConnection
impl Connection for MockConnection