pub trait Format<'a, T>: Send + Sync {
    type Error: From<Error> + Debug + Display;

    fn serialize_into<W>(&self, value: &T, writer: W) -> Result<(), Self::Error>
        W: Write
; fn serialized_size(&self, value: &T) -> Result<Option<usize>, Self::Error> { ... } fn serialize(&self, value: &T) -> Result<Vec<u8, Global>, Self::Error> { ... } }
Expand description

A serialization format.

Required Associated Types§

The error type this format produces.

Required Methods§

Serialize value into writer.

Provided Methods§

Return the number of bytes value will need to be serialized, or None if pre-measuring is not implemented for this format.

Serialize value into a Vec<u8>.