1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
2pub enum BlockType {
3 Raw,
4 RLE,
5 Compressed,
6 Reserved,
7}
8
9impl core::fmt::Display for BlockType {
10 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> {
11 match self {
12 BlockType::Compressed => write!(f, "Compressed"),
13 BlockType::Raw => write!(f, "Raw"),
14 BlockType::RLE => write!(f, "RLE"),
15 BlockType::Reserved => write!(f, "Reserverd"),
16 }
17 }
18}
19
20pub struct BlockHeader {
21 pub last_block: bool,
22 pub block_type: BlockType,
23 pub decompressed_size: u32,
24 pub content_size: u32,
25}
26