pub trait Deserializer: Sized {
// Required method
fn deserialize<R: Read>(reader: &mut R) -> Result<Self>;
// Provided method
fn try_from_slice(slice: &[u8]) -> Result<Self> { ... }
}Expand description
Counterpart to Serializer that reconstructs a value from its custom
serialized representation, complementing the Serializable wrapper.
Required Methods§
Sourcefn deserialize<R: Read>(reader: &mut R) -> Result<Self>
fn deserialize<R: Read>(reader: &mut R) -> Result<Self>
Reads and reconstructs a value of Self from the given reader.
Provided Methods§
Sourcefn try_from_slice(slice: &[u8]) -> Result<Self>
fn try_from_slice(slice: &[u8]) -> Result<Self>
Reconstructs a value of Self from a byte slice.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".