pub struct DecoderConfig { /* private fields */ }Expand description
Everything that shapes a decoding operation.
Both checksums are verified by default, as the reference does
(ZL_DParam_checkContentChecksum, ZL_DParam_checkCompressedChecksum).
§Examples
use mopenzl::{DecodeLimits, DecoderConfig, FrameMode};
let config = DecoderConfig::default()
.with_frame_mode(FrameMode::Concatenated)
.with_limits(DecodeLimits::default().with_max_output_bytes(Some(1 << 30)))
.with_content_checksum_check(false);
assert!(!config.content_checksum_check());
assert!(config.compressed_checksum_check());Implementations§
Source§impl DecoderConfig
impl DecoderConfig
Sourcepub const fn with_frame_mode(self, mode: FrameMode) -> Self
pub const fn with_frame_mode(self, mode: FrameMode) -> Self
Sets how many frames an operation decodes.
Sourcepub const fn with_limits(self, limits: DecodeLimits) -> Self
pub const fn with_limits(self, limits: DecodeLimits) -> Self
Sets the resource limits.
Sourcepub const fn with_content_checksum_check(self, enabled: bool) -> Self
pub const fn with_content_checksum_check(self, enabled: bool) -> Self
Whether chunk content checksums are verified.
Sourcepub const fn with_compressed_checksum_check(self, enabled: bool) -> Self
pub const fn with_compressed_checksum_check(self, enabled: bool) -> Self
Whether chunk compressed checksums and the header check byte are verified.
Sourcepub const fn frame_mode(&self) -> FrameMode
pub const fn frame_mode(&self) -> FrameMode
How many frames an operation decodes.
Sourcepub const fn limits(&self) -> DecodeLimits
pub const fn limits(&self) -> DecodeLimits
The resource limits.
Sourcepub const fn content_checksum_check(&self) -> bool
pub const fn content_checksum_check(&self) -> bool
Whether content checksums are verified.
Sourcepub const fn compressed_checksum_check(&self) -> bool
pub const fn compressed_checksum_check(&self) -> bool
Whether compressed checksums are verified.
Trait Implementations§
Source§impl Clone for DecoderConfig
impl Clone for DecoderConfig
impl Copy for DecoderConfig
Source§impl Debug for DecoderConfig
impl Debug for DecoderConfig
Source§impl Default for DecoderConfig
impl Default for DecoderConfig
impl Eq for DecoderConfig
Source§impl From<DecodeLimits> for DecoderConfig
impl From<DecodeLimits> for DecoderConfig
Source§fn from(limits: DecodeLimits) -> Self
fn from(limits: DecodeLimits) -> Self
Converts to this type from the input type.
Source§impl From<FrameMode> for DecoderConfig
impl From<FrameMode> for DecoderConfig
Source§impl Hash for DecoderConfig
impl Hash for DecoderConfig
Source§impl PartialEq for DecoderConfig
impl PartialEq for DecoderConfig
impl StructuralPartialEq for DecoderConfig
Auto Trait Implementations§
impl Forget for DecoderConfig
impl Freeze for DecoderConfig
impl Move for DecoderConfig
impl RefUnwindSafe for DecoderConfig
impl Send for DecoderConfig
impl Sync for DecoderConfig
impl Unpin for DecoderConfig
impl UnsafeUnpin for DecoderConfig
impl UnwindSafe for DecoderConfig
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