pub trait MessageEncode {
const MAX_SIZE: Option<usize>;
// Required methods
fn encode<W: PbWrite>(
&self,
encoder: &mut PbEncoder<W>,
) -> Result<(), W::Error>;
fn compute_size(&self) -> usize;
// Provided method
fn encode_len_delimited<W: PbWrite>(
&self,
encoder: &mut PbEncoder<W>,
) -> Result<(), W::Error> { ... }
}Expand description
Protobuf message that can be encoded onto the wire.
Implementations are auto-generated by micropb-gen.
Required Associated Constants§
Required Methods§
Sourcefn encode<W: PbWrite>(&self, encoder: &mut PbEncoder<W>) -> Result<(), W::Error>
fn encode<W: PbWrite>(&self, encoder: &mut PbEncoder<W>) -> Result<(), W::Error>
Encode this message using the encoder.
Sourcefn compute_size(&self) -> usize
fn compute_size(&self) -> usize
Compute the size of this message on the wire.
Provided Methods§
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: MessageEncode> MessageEncode for &T
Available on crate feature encode only.
impl<T: MessageEncode> MessageEncode for &T
Available on crate feature
encode only.