[][src]Trait twitchchat::ReadAdapter

pub trait ReadAdapter<W> {
    type Reader;
    type Error: Debug + Display + Error;
    fn give_writer(&mut self, writer: Writer<W>);
fn read_message(&mut self) -> Result<Message, ReadError<Self::Error>>;
fn into_inner(self) -> Self::Reader; }

ReadAdapter allows one to write different 'readers' for the twitch Client

Associated Types

type Reader

the Innr read type (can be a Unit)

type Error: Debug + Display + Error

An Error that can be returned when trying to read a message

Loading content...

Required methods

fn give_writer(&mut self, writer: Writer<W>)

Give an instance of the Writer to the reader

fn read_message(&mut self) -> Result<Message, ReadError<Self::Error>>

Tries to read a message, otherwise returns a wrapped erro

fn into_inner(self) -> Self::Reader

Consume the adapter and returns the inner reader

Loading content...

Implementors

impl<R: Read, W: Write> ReadAdapter<W> for SyncReadAdapter<R, W>[src]

type Reader = R

type Error = Error

Loading content...