Trait FromBinProtStream

Source
pub trait FromBinProtStream: BinProtRead + Sized {
    // Provided method
    fn read_from_stream<R>(r: &mut R) -> Result<Self, Error>
       where R: Read { ... }
}

Provided Methods§

Source

fn read_from_stream<R>(r: &mut R) -> Result<Self, Error>
where R: Read,

Decodes bytes from reader of byte stream into the specified type T. This function assumes that the data is prepended with 8-bytes little endian integer specirying the size.

Even if not the whole portion of the stream is read to decode to T, reader is set to the end of the current stream portion, as specified by its size.

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§

Source§

impl<T> FromBinProtStream for T
where T: BinProtRead,