pub trait Format<'a, T>: Send + Sync {
type Error: From<Error> + Debug + Display;
// Required method
fn serialize_into<W>(&self, value: &T, writer: W) -> Result<(), Self::Error>
where W: Write;
// Provided methods
fn serialized_size(&self, value: &T) -> Result<Option<usize>, Self::Error> { ... }
fn serialize(&self, value: &T) -> Result<Vec<u8>, Self::Error> { ... }
}
Expand description
A serialization format.
Required Associated Types§
Required Methods§
Provided Methods§
Object Safety§
This trait is not object safe.