pub trait BinaryTransform {
// Required method
fn transform(&self, data: Bytes) -> Result<Bytes, Error>;
// Provided method
fn transform_mut(&mut self, data: Bytes) -> Result<Bytes, Error> { ... }
}Expand description
Defines a transformation on a set of binary data.
This is specifically designed to operate on entire messages instead of streams, in order to better match now WebSocket messages are handled.
Examples are compression and decompression.