blob: 38f14023b58aa70ce254ffba17ea759b6887dcae [file] [log] [blame]
Yiming Jingebb18722021-07-16 13:15:12 -07001//! Common traits
2
3/// Common trait for structures serialization
4pub trait Serialize<O = Vec<u8>> {
5 /// Type of serialization error
6 type Error;
7 /// Try to serialize object
8 fn serialize(&self) -> Result<O, Self::Error>;
9}