pub trait Protocol {
    // Required methods
    fn session_begin(&mut self) -> Result<(), Error>;
    fn session_end(&mut self) -> Result<(), Error>;
    fn write(&mut self, message: ProtoMessage) -> Result<(), Error>;
    fn read(&mut self) -> Result<ProtoMessage, Error>;
}
Expand description

A protocol is used to encode messages in chunks that can be sent to the device and to parse chunks into messages.

Required Methods§

source

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

source

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

source

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

source

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

Implementors§