Trait Deserialize

Source
pub trait Deserialize {
    // Required method
    fn read_from<T: Read + ReadBytesExt>(
        reader: &mut T,
    ) -> Result<Self, SerializationError>
       where Self: Sized;
}
Expand description

Deserialize allows an item to be created from a binary representation. Given that there are many different ways such a conversion may fail, this operation will always yield a Result. It is not even sure that there are enough bytes available to be read for the deserialization of this item to completed successfully.

Required Methods§

Source

fn read_from<T: Read + ReadBytesExt>( reader: &mut T, ) -> Result<Self, SerializationError>
where Self: Sized,

Tries to read the data contained in reader to create and instance of Self.

May return an error if the data did not match the expected format.

Implementations on Foreign Types§

Source§

impl Deserialize for bool

Source§

fn read_from<T: Read + ReadBytesExt>( reader: &mut T, ) -> Result<Self, SerializationError>
where Self: Sized,

Source§

impl Deserialize for f32

Source§

impl Deserialize for f64

Source§

impl Deserialize for i16

Source§

impl Deserialize for i32

Source§

impl Deserialize for i64

Source§

impl Deserialize for u8

Source§

fn read_from<T: Read + ReadBytesExt>( reader: &mut T, ) -> Result<Self, SerializationError>
where Self: Sized,

Source§

impl Deserialize for u16

Source§

impl Deserialize for u32

Source§

impl Deserialize for u64

Source§

impl Deserialize for DateTime<Utc>

Implementors§