Serializable

Trait Serializable 

Source
pub trait Serializable {
    // Required methods
    fn to_bytes(&self) -> Vec<u8> ;
    fn from_bytes(bytes: &Vec<u8>) -> Self;
}
Expand description

Trait for serialization.

Required Methods§

Source

fn to_bytes(&self) -> Vec<u8>

Serialize to a vector of bytes.

Source

fn from_bytes(bytes: &Vec<u8>) -> Self

Deserialize from a vector of bytes.

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§