Middleware

Trait Middleware 

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

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§

Source

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

Processes some data.

Source

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

Un-processes some data.

Implementors§