Skip to main content

Message

Trait Message 

Source
pub trait Message:
    Default
    + Sized
    + Debug {
    // Required methods
    fn read(src: &mut Bytes) -> Result<Self, DecodeError>;
    fn write(&self, dst: &mut BytePages);
    fn encoded_len(&self) -> usize;
}
Expand description

Protobuf struct read/write operations

Required Methods§

Source

fn read(src: &mut Bytes) -> Result<Self, DecodeError>

Decodes an instance of the message from a buffer

Source

fn write(&self, dst: &mut BytePages)

Encodes and writes the message to a buffer

Source

fn encoded_len(&self) -> usize

Returns the encoded length of the message with a length delimiter

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.

Implementations on Foreign Types§

Source§

impl Message for ()

Protobuf struct read/write operations

Source§

fn encoded_len(&self) -> usize

Source§

fn read(_: &mut Bytes) -> Result<Self, DecodeError>

Source§

fn write(&self, _: &mut BytePages)

Implementors§