Struct irc::client::conn::MockConnection
[−]
[src]
pub struct MockConnection { /* fields omitted */ }
A mock connection for testing purposes.
Methods
impl MockConnection
[src]
fn empty() -> MockConnection
Creates a new mock connection with an empty read buffer.
fn new(input: &str) -> MockConnection
Creates a new mock connection with the specified string in the read buffer.
fn from_byte_vec(input: Vec<u8>) -> MockConnection
Creates a new mock connection with the specified bytes in the read buffer.
Trait Implementations
impl Connection for MockConnection
[src]
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. Read more
fn reconnect(&self) -> Result<()>
Re-establishes this connection, disconnecting from the existing case if necessary.