pub enum CompressionCodec {
Lz4Frame,
Zstd(i32),
}Expand description
Represents compressing a ipc stream using a particular compression algorithm
Variants§
Implementations§
Source§impl CompressionCodec
impl CompressionCodec
Sourcepub(crate) fn try_new_with_compression_level(
compression_type: CompressionType,
compression_level: i32,
) -> Result<Self, ArrowError>
pub(crate) fn try_new_with_compression_level( compression_type: CompressionType, compression_level: i32, ) -> Result<Self, ArrowError>
Creates a CompressionCodec with an explicit compression level.
The level is used for CompressionType::ZSTD.
CompressionType::LZ4_FRAME does not yet support compression levels
and ignores this value. Returns an error for unsupported compression
types.
Sourcepub(crate) fn compress_to_vec(
&self,
input: &[u8],
output: &mut Vec<u8>,
context: &mut IpcWriteContext,
) -> Result<usize, ArrowError>
pub(crate) fn compress_to_vec( &self, input: &[u8], output: &mut Vec<u8>, context: &mut IpcWriteContext, ) -> Result<usize, ArrowError>
Compresses the data in input to output and appends the
data using the specified compression mechanism.
returns the number of bytes written to the stream
Writes this format to output:
[8 bytes]: uncompressed length
[remaining bytes]: compressed data streamSourcepub(crate) fn decompress_to_buffer(
&self,
input: &Buffer,
context: &mut DecompressionContext,
) -> Result<Buffer, ArrowError>
pub(crate) fn decompress_to_buffer( &self, input: &Buffer, context: &mut DecompressionContext, ) -> Result<Buffer, ArrowError>
Decompresses the input into a [Buffer]
The input should look like:
[8 bytes]: uncompressed length
[remaining bytes]: compressed data streamSourcefn compress(
&self,
input: &[u8],
output: &mut Vec<u8>,
context: &mut IpcWriteContext,
) -> Result<(), ArrowError>
fn compress( &self, input: &[u8], output: &mut Vec<u8>, context: &mut IpcWriteContext, ) -> Result<(), ArrowError>
Compress the data in input buffer and write to output buffer using the specified compression
Sourcefn decompress(
&self,
input: &[u8],
decompressed_size: usize,
context: &mut DecompressionContext,
) -> Result<Vec<u8>, ArrowError>
fn decompress( &self, input: &[u8], decompressed_size: usize, context: &mut DecompressionContext, ) -> Result<Vec<u8>, ArrowError>
Decompress the data in input buffer and write to output buffer using the specified compression
Trait Implementations§
Source§impl Clone for CompressionCodec
impl Clone for CompressionCodec
Source§fn clone(&self) -> CompressionCodec
fn clone(&self) -> CompressionCodec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CompressionCodec
Source§impl Debug for CompressionCodec
impl Debug for CompressionCodec
impl Eq for CompressionCodec
Source§impl PartialEq for CompressionCodec
impl PartialEq for CompressionCodec
Source§fn eq(&self, other: &CompressionCodec) -> bool
fn eq(&self, other: &CompressionCodec) -> bool
self and other values to be equal, and is used by ==.