substrate-data 0.1.0

One data model, text syntax, binary form, packed frames and schema system — for any program's files, saves and wire messages.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! The header and the fixed sizes of the binary form.

/// What a binary file starts with.
pub const MAGIC: &[u8; 4] = b"SDAT";
/// The version of the form after the magic.
pub const VERSION: u8 = 1;

/// Nested deeper than this is malformed.
pub const MAX_DEPTH: usize = 256;

/// A stream's length: fixed width, so the writer fills it in after its items.
pub(crate) const STREAM_LEN_BYTES: usize = 4;

/// A string's varint: a new one's (odd, its length) or a reference to the
/// table (even, its index).
pub(crate) const NEW_STRING: u64 = 1;