rave_types 0.1.2

Common types for rave.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// TODO: generalize Unit type over codec
use crate::codec::Codec;

pub struct Unit<C: Codec> {
    pub data: C::Data,
}

impl<C: Codec> Unit<C> {
    pub fn new(data: C::Data) -> Self {
        Self { data }
    }

    pub fn into_data(self) -> C::Data {
        self.data
    }
}