pub trait MessageDecode {
// Required method
fn decode<R: PbRead>(
&mut self,
decoder: &mut PbDecoder<R>,
len: usize,
) -> Result<(), DecodeError<R::Error>>;
// Provided methods
fn decode_from_bytes(
&mut self,
bytes: &[u8],
) -> Result<(), DecodeError<Infallible>> { ... }
fn decode_len_delimited<R: PbRead>(
&mut self,
decoder: &mut PbDecoder<R>,
) -> Result<(), DecodeError<R::Error>> { ... }
}Expand description
Protobuf message that can be decoded from the wire.
Implementations are auto-generated by micropb-gen.
Required Methods§
Provided Methods§
Sourcefn decode_from_bytes(
&mut self,
bytes: &[u8],
) -> Result<(), DecodeError<Infallible>>
fn decode_from_bytes( &mut self, bytes: &[u8], ) -> Result<(), DecodeError<Infallible>>
Decode an instance of the message from the provided bytes
Sourcefn decode_len_delimited<R: PbRead>(
&mut self,
decoder: &mut PbDecoder<R>,
) -> Result<(), DecodeError<R::Error>>
fn decode_len_delimited<R: PbRead>( &mut self, decoder: &mut PbDecoder<R>, ) -> Result<(), DecodeError<R::Error>>
Decode an instance of the message from the decoder as a length-delimited record, starting with a length prefix.
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<T: MessageDecode> MessageDecode for &mut T
Available on crate feature decode only.
impl<T: MessageDecode> MessageDecode for &mut T
Available on crate feature
decode only.