pub trait Serializable: Send + Sync + Sized + 'static {
    fn serialize_to<W: WriteBytesExt>(
        writer: &mut W
    ) -> Result<usize, Error>;
fn deserialize_from<R: ReadBytesExt>(reader: &mut R) -> Result<Self, Error>; }
Expand description

A type that can be serialized and deserialized.

Required methods

Serializes into writer and returns the number of bytes written.

Deserializes from reader, and returns the deserialized instance. Implementors should not expect for the reader to be fully consumed at the end of this call.

Implementations on Foreign Types