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§
Sourcefn from_bytes(bytes: &[u8]) -> Result<Self>where
Self: Sized,
fn from_bytes(bytes: &[u8]) -> Result<Self>where
Self: Sized,
从字节数组反序列化