pub struct FrameHeader {
pub window_size: u64,
pub content_size: Option<u64>,
pub dict_id: u32,
pub checksum: bool,
pub single_segment: bool,
pub header_len: usize,
}Expand description
A parsed frame header.
Fields§
§window_size: u64Window size in bytes (equal to the content size for single-segment frames).
content_size: Option<u64>Declared decompressed size, if recorded.
dict_id: u320 when the frame names no dictionary.
checksum: boolA 4-byte XXH64-based checksum follows the last block.
single_segment: boolNo window descriptor: the window is the whole content.
header_len: usizeBytes from the magic number through the end of the header.
Implementations§
Source§impl FrameHeader
impl FrameHeader
Sourcepub fn parse(src: &[u8]) -> Result<FrameHeader>
pub fn parse(src: &[u8]) -> Result<FrameHeader>
Parses the header of a zstd frame starting at src[0] (the magic number).
Sourcepub fn parse_format(src: &[u8], format: FrameFormat) -> Result<FrameHeader>
pub fn parse_format(src: &[u8], format: FrameFormat) -> Result<FrameHeader>
Parses a frame header in the given format.
Sourcepub fn write(&self, window_log: u32, out: &mut Vec<u8>)
pub fn write(&self, window_log: u32, out: &mut Vec<u8>)
Appends this header (magic included). window_log is used when not single-segment.
Sourcepub fn write_format(
&self,
format: FrameFormat,
window_log: u32,
out: &mut Vec<u8>,
)
pub fn write_format( &self, format: FrameFormat, window_log: u32, out: &mut Vec<u8>, )
Appends this header in the given format.
Trait Implementations§
Source§impl Clone for FrameHeader
impl Clone for FrameHeader
impl Copy for FrameHeader
Source§impl Debug for FrameHeader
impl Debug for FrameHeader
impl Eq for FrameHeader
Source§impl PartialEq for FrameHeader
impl PartialEq for FrameHeader
impl StructuralPartialEq for FrameHeader
Auto Trait Implementations§
impl Freeze for FrameHeader
impl RefUnwindSafe for FrameHeader
impl Send for FrameHeader
impl Sync for FrameHeader
impl Unpin for FrameHeader
impl UnsafeUnpin for FrameHeader
impl UnwindSafe for FrameHeader
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