pub trait PerValueCompressor:
Debug
+ Send
+ Sync {
// Required method
fn compress(
&self,
data: DataBlock,
) -> Result<(PerValueDataBlock, ArrayEncoding)>;
}
Expand description
Trait for compression algorithms that are suitable for use in the zipped structural encoding
This compression must return either a FixedWidthDataBlock or a VariableWidthBlock. This is because we need to zip the data and those are the only two blocks we know how to zip today.
In addition, the compressed data must be able to be decompressed in a random-access fashion. This means that the decompression algorithm must be able to decompress any value without decompressing all values before it.
Required Methods§
Sourcefn compress(
&self,
data: DataBlock,
) -> Result<(PerValueDataBlock, ArrayEncoding)>
fn compress( &self, data: DataBlock, ) -> Result<(PerValueDataBlock, ArrayEncoding)>
Compress the data into a single buffer
Also returns a description of the compression that can be used to decompress when reading the data back