pub trait Serializable<T> {
// Required methods
fn from_bytes(bytes: &[u8]) -> Result<T, ParseError>;
fn to_bytes(&self) -> Result<Vec<u8>, ParseError>;
}Required Methods§
fn from_bytes(bytes: &[u8]) -> Result<T, ParseError>
fn to_bytes(&self) -> Result<Vec<u8>, ParseError>
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.