Serializable

Trait Serializable 

Source
pub trait Serializable<T> {
    // Required methods
    fn read(reader: &mut dyn Read) -> Result<T>
       where Self: Sized;
    fn write(&self, writer: &mut dyn Write) -> Result<()>;
}
Expand description

An object that may be serialized and deserialized

Required Methods§

Source

fn read(reader: &mut dyn Read) -> Result<T>
where Self: Sized,

Reads the object from serialized form

Source

fn write(&self, writer: &mut dyn Write) -> Result<()>

Writes the object to serialized form

Implementations on Foreign Types§

Source§

impl Serializable<[u8; 16]> for [u8; 16]

Source§

fn read(reader: &mut dyn Read) -> Result<[u8; 16]>

Source§

fn write(&self, writer: &mut dyn Write) -> Result<()>

Source§

impl Serializable<[u8; 32]> for [u8; 32]

Source§

fn read(reader: &mut dyn Read) -> Result<[u8; 32]>

Source§

fn write(&self, writer: &mut dyn Write) -> Result<()>

Implementors§