pub struct Zstd {
pub use_dict: bool,
/* private fields */
}
Expand description
Zstd compression structure. Supports a compression dictionary per column.
Fields§
§use_dict: bool
Uses custom dictionaries to compress data.
Implementations§
Source§impl Zstd
impl Zstd
Sourcepub const fn new(use_dict: bool, max_dict_size: usize, columns: usize) -> Self
pub const fn new(use_dict: bool, max_dict_size: usize, columns: usize) -> Self
Creates new Zstd
.
Sourcepub const fn with_level(self, level: i32) -> Self
pub const fn with_level(self, level: i32) -> Self
Sets the compression level for the Zstd compression instance.
Sourcepub fn decompressors(&self) -> Result<Vec<Decompressor<'_>>, NippyJarError>
pub fn decompressors(&self) -> Result<Vec<Decompressor<'_>>, NippyJarError>
Creates a list of Decompressor
if using dictionaries.
Sourcepub fn compressors(&self) -> Result<Option<Vec<Compressor<'_>>>, NippyJarError>
pub fn compressors(&self) -> Result<Option<Vec<Compressor<'_>>>, NippyJarError>
If using dictionaries, creates a list of [Compressor
].
Sourcepub fn compress_with_dictionary(
column_value: &[u8],
buffer: &mut Vec<u8>,
handle: &mut File,
compressor: Option<&mut Compressor<'_>>,
) -> Result<(), NippyJarError>
pub fn compress_with_dictionary( column_value: &[u8], buffer: &mut Vec<u8>, handle: &mut File, compressor: Option<&mut Compressor<'_>>, ) -> Result<(), NippyJarError>
Compresses a value using a dictionary. Reserves additional capacity for buffer
if
necessary.
Sourcepub fn decompress_with_dictionary(
column_value: &[u8],
output: &mut Vec<u8>,
decompressor: &mut Decompressor<'_>,
) -> Result<(), NippyJarError>
pub fn decompress_with_dictionary( column_value: &[u8], output: &mut Vec<u8>, decompressor: &mut Decompressor<'_>, ) -> Result<(), NippyJarError>
Appends a decompressed value using a dictionary to a user provided buffer.
Trait Implementations§
Source§impl Compression for Zstd
impl Compression for Zstd
Source§fn 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.Source§fn decompress(&self, value: &[u8]) -> Result<Vec<u8>, NippyJarError>
fn decompress(&self, value: &[u8]) -> Result<Vec<u8>, NippyJarError>
Returns decompressed data.
Source§fn 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. Read moreSource§impl<'de> Deserialize<'de> for Zstd
impl<'de> Deserialize<'de> for Zstd
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Zstd
impl RefUnwindSafe for Zstd
impl Send for Zstd
impl Sync for Zstd
impl Unpin for Zstd
impl UnwindSafe for Zstd
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> NippyJarHeader for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes