bencode inspired tight self describing serialization format
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
#[repr(u8)]
#[derive(Copy, Clone, Debug)]
pub enum T {
    False = 0,
    True = 1,

    Int = b'i',
    Uint = b'u',
    Float = b'f',
    Double = b'd',
    String = b's',
    NVariant = b'v',
    TVariant = b'x',
    SVariant = b'y',
    UVariant = b'n',
    List = b'l',
    // Tuple = b't',
    Map = b'm',
    None = b'z',
    Some = b'o',
}
impl PartialEq<u8> for T {
    fn eq(&self, other: &u8) -> bool {
        *self as u8 == *other
    }
}