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 raw_encoder = EncodeOptions::new()
.checksum_flag(false)
.compression_level(5)
.frame_size_policy(FrameSizePolicy::Uncompressed(8192))
.into_raw()?;
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 initial 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(self) -> Result<RawEncoder<'a>>
pub fn into_raw(self) -> Result<RawEncoder<'a>>
Sourcepub fn into_encoder<W>(self, writer: W) -> Result<Encoder<'a, W>>
pub fn into_encoder<W>(self, writer: W) -> Result<Encoder<'a, W>>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for EncodeOptions<'a>
impl<'a> RefUnwindSafe for EncodeOptions<'a>
impl<'a> Send for EncodeOptions<'a>
impl<'a> Sync for EncodeOptions<'a>
impl<'a> Unpin for EncodeOptions<'a>
impl<'a> UnwindSafe for EncodeOptions<'a>
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