pub trait Compression: Serialize + for<'a> Deserialize<'a> {
// Required methods
fn decompress_to(
&self,
value: &[u8],
dest: &mut Vec<u8>,
) -> Result<(), NippyJarError>;
fn decompress(&self, value: &[u8]) -> Result<Vec<u8>, NippyJarError>;
fn compress_to(
&self,
src: &[u8],
dest: &mut Vec<u8>,
) -> Result<usize, NippyJarError>;
fn compress(&self, src: &[u8]) -> Result<Vec<u8>, NippyJarError>;
// Provided method
fn is_ready(&self) -> bool { ... }
}
Expand description
Trait that will compress column values
Required Methods§
Sourcefn decompress_to(
&self,
value: &[u8],
dest: &mut Vec<u8>,
) -> Result<(), NippyJarError>
fn decompress_to( &self, value: &[u8], dest: &mut Vec<u8>, ) -> Result<(), NippyJarError>
Appends decompressed data to the dest buffer. Requires dest
to have sufficient capacity.
Sourcefn decompress(&self, value: &[u8]) -> Result<Vec<u8>, NippyJarError>
fn decompress(&self, value: &[u8]) -> Result<Vec<u8>, NippyJarError>
Returns decompressed data.
Sourcefn compress_to(
&self,
src: &[u8],
dest: &mut Vec<u8>,
) -> Result<usize, NippyJarError>
fn compress_to( &self, src: &[u8], dest: &mut Vec<u8>, ) -> Result<usize, NippyJarError>
Appends compressed data from src
to dest
. dest
. Requires dest
to have sufficient
capacity.
Returns number of bytes written to dest
.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.