Handling the frame itself

You are reaching the end of the frame parsing! It is time to put the various bits together.

Building the type

✅ Make the frame::ZstandardFrame structure contain three fields: the frame header, a vector of blocks, and an optional checksum.


✅ Implement ZstandardFrame::parse() and call it from Frame::parse() in the presence of a Zstandard frame.

This method will need to:

  • parse the header;
  • parse the blocks (there is at least one), and continue doing so as long as the parsed block is not the last one;
  • parse the checksum if it is present according to the frame descriptor header.


✅ Implement ZstandardFrame::decode() and call it from Frame::decode() in the presence of a Zstandard frame.

Decoding a frame means decoding each block in turn and concatenating the result.