Trait Serializable

Source
pub trait Serializable
where Self: Sized,
{ type ReadError; type WriteError; // Required methods fn deserialize(buff: &mut DataRead<'_>) -> Result<Self, Self::ReadError>; fn serialize( &self, buff: &mut DataWrite<'_>, ) -> Result<(), Self::WriteError>; }
Expand description

basic serialization/deserialization functions

Required Associated Types§

Required Methods§

Source

fn deserialize(buff: &mut DataRead<'_>) -> Result<Self, Self::ReadError>

deserialize self from a binary buffer

Source

fn serialize(&self, buff: &mut DataWrite<'_>) -> Result<(), Self::WriteError>

transform self into a binary buffer

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.

Implementors§