Trait parquet::compression::Codec [−][src]
pub trait Codec {
fn compress(&mut self, input_buf: &[u8]) -> Result<Vec<u8>>;
fn decompress(
&mut self,
input_buf: &[u8],
output_buf: &mut Vec<u8>
) -> Result<usize>;
}Parquet compression codec interface.
Required Methods
fn compress(&mut self, input_buf: &[u8]) -> Result<Vec<u8>>
Compresses data stored in slice input_buf and returns a new vector with the
compressed data.
TODO: it's better to pass in vec here (e.g., allow reuse),
but flate2 api doesn't support this.
fn decompress(
&mut self,
input_buf: &[u8],
output_buf: &mut Vec<u8>
) -> Result<usize>
&mut self,
input_buf: &[u8],
output_buf: &mut Vec<u8>
) -> Result<usize>
Decompresses data stored in slice input_buf and writes output to output_buf.
Returns the total number of bytes written.
Implementors
impl Codec for SnappyCodecimpl Codec for GZipCodecimpl Codec for BrotliCodecimpl Codec for LZ4Codec