pub trait Serializer<T>: Send + Sync {
// Required methods
fn identifier(&self) -> u32;
fn manifest(&self) -> &'static str;
fn to_bytes(&self, value: &T) -> Result<Vec<u8>, SerializerError>;
fn from_bytes(&self, bytes: &[u8]) -> Result<T, SerializerError>;
}Required Methods§
fn identifier(&self) -> u32
fn manifest(&self) -> &'static str
fn to_bytes(&self, value: &T) -> Result<Vec<u8>, SerializerError>
fn from_bytes(&self, bytes: &[u8]) -> Result<T, SerializerError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".