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§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".