pub trait PackableCodec: SingularCodec {
// Required method
fn encode_packed(value: &Self::Value, buf: &mut Vec<u8>);
}Expand description
Codecs whose elements can be concatenated into a packed wire form.
Only varint-family and fixed-width scalars are packable. String, bytes,
and message use LengthDelimited for a single value, so there’s no
distinct packed encoding.
Required Methods§
Sourcefn encode_packed(value: &Self::Value, buf: &mut Vec<u8>)
fn encode_packed(value: &Self::Value, buf: &mut Vec<u8>)
Write one value’s wire payload (without tag) into buf.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".