pub trait Format<T>: Sized {
type SerError: Error + Send + Sync + 'static;
type DeError: Error + Send + Sync + 'static;
// Required methods
fn to_bytes(value: &T) -> Result<Vec<u8>, Self::SerError>;
fn from_bytes(data: Vec<u8>) -> Result<T, Self::DeError>;
}Expand description
Trait implementable by format providers.
By implementing this trait, a type becomes a marker for the specified format. That type can then be used for formatting (without instantiating an object of that type).
Required Associated Types§
Required Methods§
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.