pub trait SerDe: Sized {
// Required methods
fn serialize<W: Write>(
sink: &mut W,
values: &[Self],
) -> Result<(), SerializeError<Self>>;
fn deserialize<R: Read>(
source: &mut R,
existing_bytes: DeserializeBytes,
) -> DeserializeResult<Self>;
}
Expand description
A trait for serializing or deserializing multiple items at once and defragmenting partially serialized items when new bytes become available.
Required Methods§
fn serialize<W: Write>( sink: &mut W, values: &[Self], ) -> Result<(), SerializeError<Self>>
fn deserialize<R: Read>( source: &mut R, existing_bytes: DeserializeBytes, ) -> DeserializeResult<Self>
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.