Trait Serializer

Source
pub trait Serializer {
    // Required methods
    fn to_bytes(&self) -> Result<Vec<u8>>;
    fn from_bytes(bytes: &[u8]) -> Result<Self>
       where Self: Sized;
}
Expand description

序列化特征

Required Methods§

Source

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

序列化为字节数组

Source

fn from_bytes(bytes: &[u8]) -> Result<Self>
where Self: Sized,

从字节数组反序列化

Implementors§