1
2
3
4
5
6
7
8
9
//! Common traits

/// Common trait for structures serialization
pub trait Serialize<O = Vec<u8>> {
    /// Type of serialization error
    type Error;
    /// Try to serialize object
    fn serialize(&self) -> Result<O, Self::Error>;
}