substrate_data/wire/binary/layout.rs
1//! The header and the fixed sizes of the binary form.
2
3/// What a binary file starts with.
4pub const MAGIC: &[u8; 4] = b"SDAT";
5/// The version of the form after the magic.
6pub const VERSION: u8 = 1;
7
8/// Nested deeper than this is malformed.
9pub const MAX_DEPTH: usize = 256;
10
11/// A stream's length: fixed width, so the writer fills it in after its items.
12pub const STREAM_LEN_BYTES: usize = 4;
13
14/// A string's varint: a new one's (odd, its length) or a reference to the
15/// table (even, its index).
16pub const NEW_STRING: u64 = 1;