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§
Sourcefn read(src: &mut Bytes) -> Result<Self, DecodeError>
fn read(src: &mut Bytes) -> Result<Self, DecodeError>
Decodes an instance of the message from a buffer
Sourcefn encoded_len(&self) -> usize
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.