pub trait Serializable {
// Required methods
fn to_bytes(&self) -> Vec<u8> ⓘ;
fn from_bytes(bytes: &Vec<u8>) -> Self;
}Expand description
Trait for serialization.
Required Methods§
Sourcefn from_bytes(bytes: &Vec<u8>) -> Self
fn from_bytes(bytes: &Vec<u8>) -> Self
Deserialize from a vector of bytes.
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.