1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use minicbor::{Decode, Encode};

#[derive(Debug, Clone, Encode, Decode)]
#[rustfmt::skip]
#[cbor(map)]
pub struct Attribute<'a> {
    #[cbor(b(1), with = "minicbor::bytes")]
    val: &'a [u8]
}

impl<'a> Attribute<'a> {
    pub fn new(val: &'a [u8]) -> Self {
        Attribute { val }
    }

    pub fn value(&self) -> &'a [u8] {
        self.val
    }
}