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
//! Bencode protocol character and byte constants.
//!
//! All bencode format markers are defined here to ensure consistency
//! across parsers and stringifiers. Use the char variants with `ISource`-based
//! parsers and the byte variants (`BYTE_*`) with raw byte-slice parsers and
//! byte-level output destinations.
// ── Char constants (for ISource / char-based parsers) ────────────────────────
/// Integer start marker ('i'). Format: `i<digits>e`
pub const INTEGER_START: char = 'i';
/// Universal end marker ('e'). Terminates integers, lists, and dictionaries.
pub const END_MARKER: char = 'e';
/// List start marker ('l'). Format: `l<items>e`
pub const LIST_START: char = 'l';
/// Dictionary start marker ('d'). Format: `d<key><value>...e`
pub const DICT_START: char = 'd';
/// String length/content separator (':'). Format: `<length>:<bytes>`
pub const STRING_SEP: char = ':';
// ── Byte constants (for byte-slice parsers and byte-level output) ─────────────
/// Integer start marker byte (`b'i'`).
pub const BYTE_INTEGER_START: u8 = b'i';
/// Universal end marker byte (`b'e'`).
pub const BYTE_END: u8 = b'e';
/// List start marker byte (`b'l'`).
pub const BYTE_LIST_START: u8 = b'l';
/// Dictionary start marker byte (`b'd'`).
pub const BYTE_DICT_START: u8 = b'd';
/// String length/content separator byte (`b':'`).
pub const BYTE_STRING_SEP: u8 = b':';