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