quick_protobuf::message

Trait MessageRead

Source
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

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§