pub trait BlockCompressor:
Debug
+ Send
+ Sync {
// Required method
fn compress(
&self,
data: DataBlock,
) -> Result<(Option<LanceBuffer>, CompressiveEncoding)>;
}Expand description
Trait for compression algorithms that compress an entire block of data into one opaque and self-described chunk.
This is actually a third compression strategy used in a few corner cases today (TODO: remove?)
This is the most general type of compression. There are no constraints on the method of compression it is assumed that the entire block of data will be present at decompression.
This is the least appropriate strategy for random access because we must load the entire block to access any single value. This should only be used for cases where random access is never required (e.g. when encoding metadata buffers like a dictionary or for encoding rep/def mini-block chunks)
Required Methods§
Sourcefn compress(
&self,
data: DataBlock,
) -> Result<(Option<LanceBuffer>, CompressiveEncoding)>
fn compress( &self, data: DataBlock, ) -> Result<(Option<LanceBuffer>, CompressiveEncoding)>
Compress the data into zero or one buffers and describe the codec used.
None represents a metadata-only codec. Some represents a physical
payload, including a zero-byte payload.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".