rusticata_macros/
traits.rs

1//! Common traits
2
3#[cfg(not(feature = "std"))]
4use alloc::vec::Vec;
5
6/// Common trait for structures serialization
7pub trait Serialize<O = Vec<u8>> {
8    /// Type of serialization error
9    type Error;
10    /// Try to serialize object
11    fn serialize(&self) -> Result<O, Self::Error>;
12}