[][src]Trait protocol::wire::middleware::Middleware

pub trait Middleware: Debug {
    fn encode_data(&mut self, data: Vec<u8>) -> Result<Vec<u8>, Error>;
fn decode_data(&mut self, data: Vec<u8>) -> Result<Vec<u8>, Error>; }

A hook that sits between reading and writing packets.

Applies one transformation encoding the data, and performs the opposite transformation to decode it.

Required methods

fn encode_data(&mut self, data: Vec<u8>) -> Result<Vec<u8>, Error>

Processes some data.

fn decode_data(&mut self, data: Vec<u8>) -> Result<Vec<u8>, Error>

Un-processes some data.

Loading content...

Implementors

impl Middleware for Compression[src]

fn decode_data(&mut self, data: Vec<u8>) -> Result<Vec<u8>, Error>[src]

Un-processes some data.

impl Middleware for RotateBytes[src]

Loading content...