pub trait Compression: Sized {
type Data;
type CompressedData;
// Required methods
fn compress(&self, data: &Self::Data) -> Compressed<Self>;
fn decompress(compressed: &Self::CompressedData) -> Self::Data;
}Expand description
An algorithm for:
1. compressing a specific type Data into type Compressed
2. decompressing Compressed back into Data
Required Associated Types§
type Data
type CompressedData
Required Methods§
fn compress(&self, data: &Self::Data) -> Compressed<Self>
fn decompress(compressed: &Self::CompressedData) -> Self::Data
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.