minicbor-derive 0.19.3

Derive minicbor `Decode` and `Encode` traits.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// The encoding to use for structs and enum variants.
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
pub enum Encoding {
    #[default]
    Array,
    Map
}

impl Encoding {
    pub fn is_array(self) -> bool {
        matches!(self, Self::Array)
    }

    pub fn is_map(self) -> bool {
        matches!(self, Self::Map)
    }
}