pub enum ContentChecksum {
None,
EmitOnly,
Verify,
}Expand description
How the decoder treats a frame’s optional XXH64 content checksum (RFC 8878 Content_Checksum_flag). The XXH64 pass over the decompressed output is a measurable share of decode time, so it is made skippable.
use structured_zstd::decoding::{ContentChecksum, FrameDecoder};
let mut decoder = FrameDecoder::new();
decoder.set_content_checksum(ContentChecksum::Verify);Variants§
None
Skip the XXH64 pass entirely: no compute, no verify.
get_calculated_checksum() returns None.
EmitOnly
Compute the checksum and expose it via the accessors, but do not error on a mismatch. This is the default and matches the historical behaviour (callers verify manually if they wish).
Verify
Compute the checksum and compare it against the frame’s stored value;
a disagreement fails the decode with
FrameDecoderError::ChecksumMismatch.
Without the hash feature there is no way to compute a digest, so
Verify cannot detect a mismatch and behaves like None.
Trait Implementations§
Source§impl Clone for ContentChecksum
impl Clone for ContentChecksum
Source§fn clone(&self) -> ContentChecksum
fn clone(&self) -> ContentChecksum
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ContentChecksum
Source§impl Debug for ContentChecksum
impl Debug for ContentChecksum
Source§impl Default for ContentChecksum
impl Default for ContentChecksum
Source§fn default() -> ContentChecksum
fn default() -> ContentChecksum
Returns the “default value” for a type. Read more
impl Eq for ContentChecksum
Source§impl PartialEq for ContentChecksum
impl PartialEq for ContentChecksum
Source§fn eq(&self, other: &ContentChecksum) -> bool
fn eq(&self, other: &ContentChecksum) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ContentChecksum
Auto Trait Implementations§
impl Freeze for ContentChecksum
impl RefUnwindSafe for ContentChecksum
impl Send for ContentChecksum
impl Sync for ContentChecksum
impl Unpin for ContentChecksum
impl UnsafeUnpin for ContentChecksum
impl UnwindSafe for ContentChecksum
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