1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! # RYGRANS Container Format v1 — types and serialization
//!
//! This module implements the versioned block-streaming container format.
//! Every function is bounds-checked, every allocation is limited, and every
//! struct has canonical serialization.
/// Magic bytes for RYGRANS v1 containers.
pub const MAGIC: & = b"RYGRANS\0";
/// Current major version.
pub const MAJOR_VERSION: u16 = 1;
/// Current minor version.
pub const MINOR_VERSION: u16 = 0;
/// Header size in bytes.
pub const HEADER_SIZE: usize = 32;
/// Block header size in bytes.
pub const BLOCK_HEADER_SIZE: usize = 104;
/// Footer size in bytes.
pub const FOOTER_SIZE: usize = 104;
/// Block tag.
pub const BLOCK_TAG: & = b"BLK1";
/// Footer tag.
pub const FOOTER_TAG: & = b"END1";
/// Block kind: RAW (uncompressed).
pub const BLOCK_KIND_RAW: u8 = 0;
/// Block kind: RLE (single-symbol run-length).
pub const BLOCK_KIND_RLE: u8 = 1;
/// Block kind: RANS (rANS-compressed).
pub const BLOCK_KIND_RANS: u8 = 2;