pub struct BlockHeader {
pub last_block: bool,
pub block_type: BlockType,
pub block_size: u32,
}Expand description
Parsed three-byte header that introduces every block inside a Zstandard frame.
Fields§
§last_block: booltrue if this is the last block of the current frame.
block_type: BlockTypeEncoding type of the following payload.
block_size: u32For Raw and Compressed blocks the payload byte count; for Rle the run length.
Implementations§
Source§impl BlockHeader
impl BlockHeader
Sourcepub fn parse(src: &[u8]) -> Result<Self>
pub fn parse(src: &[u8]) -> Result<Self>
Parse a block header from the start of src. Returns
Error::UnexpectedEof if fewer than
Self::SIZE bytes are available, or Error::Corruption
for the reserved block-type code.
Trait Implementations§
Source§impl Clone for BlockHeader
impl Clone for BlockHeader
impl Copy for BlockHeader
Source§impl Debug for BlockHeader
impl Debug for BlockHeader
impl Eq for BlockHeader
Source§impl PartialEq for BlockHeader
impl PartialEq for BlockHeader
impl StructuralPartialEq for BlockHeader
Auto Trait Implementations§
impl Freeze for BlockHeader
impl RefUnwindSafe for BlockHeader
impl Send for BlockHeader
impl Sync for BlockHeader
impl Unpin for BlockHeader
impl UnsafeUnpin for BlockHeader
impl UnwindSafe for BlockHeader
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