pub trait MessageRead<'a>: Sized {
    // Required method
    fn from_reader(r: &mut BytesReader, bytes: &'a [u8]) -> Result<Self>;
}
Expand description

A trait to handle deserialization from protocol buffers.

Required Methods§

source

fn from_reader(r: &mut BytesReader, bytes: &'a [u8]) -> Result<Self>

Constructs an instance of Self by reading from the given bytes via the given reader.

It does NOT read message length first. If you want to read a variable length message, use BytesReader::read_message directly

Object Safety§

This trait is not object safe.

Implementors§