pub trait Compressible {
// Required method
fn compress(&self, format: CompressionFormat) -> Result<Vec<u8>>;
}Expand description
Internal trait to implement compression over a data type.
See also Decompressible for the reverse operation.
Required Methods§
Sourcefn compress(&self, format: CompressionFormat) -> Result<Vec<u8>>
fn compress(&self, format: CompressionFormat) -> Result<Vec<u8>>
This function compress the data of a file, returning the compressed data.
§Arguments
format- TheCompressionFormatto use for compression.
§Returns
A Vec<u8> containing the compressed data, or an error if compression failed.