pub struct EncodeOptions<'a> { /* private fields */ }Expand description
Options that configure how data is compressed.
§Examples
Supports builder like chaining.
use zeekstd::{EncodeOptions, FrameSizePolicy};
let encoder = EncodeOptions::new()
.checksum_flag(false)
.compression_level(5)
.frame_size_policy(FrameSizePolicy::Uncompressed(8192))
.into_raw_encoder()?;Implementations§
Source§impl<'a> EncodeOptions<'a>
impl<'a> EncodeOptions<'a>
Sourcepub fn try_new() -> Option<Self>
pub fn try_new() -> Option<Self>
Tries to create new options with default values.
Returns None if allocation of CCtx fails.
Sourcepub fn frame_size_policy(self, policy: FrameSizePolicy) -> Self
pub fn frame_size_policy(self, policy: FrameSizePolicy) -> Self
Sets a FrameSizePolicy.
Sourcepub fn checksum_flag(self, flag: bool) -> Self
pub fn checksum_flag(self, flag: bool) -> Self
Whether to write 32 bit checksums at the end of frames.
Sourcepub fn compression_level(self, level: CompressionLevel) -> Self
pub fn compression_level(self, level: CompressionLevel) -> Self
Sets the compression level used by zstd.
Sourcepub fn into_raw_encoder(self) -> Result<RawEncoder<'a>>
pub fn into_raw_encoder(self) -> Result<RawEncoder<'a>>
Sourcepub fn into_encoder<W>(self, writer: W) -> Result<Encoder<'a, W>>
Available on crate feature std only.
pub fn into_encoder<W>(self, writer: W) -> Result<Encoder<'a, W>>
std only.