1 //! Common traits
2
3 /// Common trait for structures serialization
4 pub trait Serialize<O = Vec<u8>> {
5 /// Type of serialization error
6 type Error;
7 /// Try to serialize object
serialize(&self) -> Result<O, Self::Error>8 fn serialize(&self) -> Result<O, Self::Error>;
9 }
10