[][src]Trait new_home_application::net::tcp_writer::TcpWriter

pub trait TcpWriter {
    fn write_line(&mut self, message: &String) -> Result<(), Error>;
fn write(&mut self, message: &String) -> Result<usize, Error>;
fn flush(&mut self) -> Result<(), Error>; }

The TcpWriter trait is meant to abstract some kind of a stream writer This is useful in unit tests where a writer type is required as dependency in other classes

Required methods

fn write_line(&mut self, message: &String) -> Result<(), Error>

Writes a line and flushes the connected std::net::BufWriter

fn write(&mut self, message: &String) -> Result<usize, Error>

Writes characters to the connected std::net::BufWriter This requires a manual flush or line breaks if wanted

fn flush(&mut self) -> Result<(), Error>

Flushes the connected std::net::BufWriter and sends data from the buffer to the client

Loading content...

Implementors

impl TcpWriter for TcpWriterImpl[src]

Loading content...