pub trait Serializablewhere
Self: Sized,{
// Required methods
fn serialize(&self) -> Result<Vec<u8>, Error>;
fn deserialize<R: Read>(reader: &mut R) -> Result<Self, DecodeError>;
}
Expand description
Trait used to de/serialize an object to/from a vector of bytes.
Required Methods§
Sourcefn deserialize<R: Read>(reader: &mut R) -> Result<Self, DecodeError>
fn deserialize<R: Read>(reader: &mut R) -> Result<Self, DecodeError>
Deserialize the object.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.