Skip to main content

decode_block

Function decode_block 

Source
pub fn decode_block(bytes: &[u8]) -> Result<DecodedBlock, BlockFormatError>
Expand description

Parses a block file. Checks, in order: length, magic, format version, declared-vs-actual size, checksum, then structure. Nothing is allocated from a length field until that length has been checked against the bytes actually present.