pub trait Packer {
// Required method
fn pack(&self, writer: &mut BytesMut) -> Result<()>;
}Expand description
Trait for types that can be packed into a compact binary format.
This trait provides compact serialization without schema evolution support. Use this when you need maximum performance and don’t require forward/backward compatibility.
§Errors
Returns EncoderError if the value cannot be packed.
Required Methods§
Sourcefn pack(&self, writer: &mut BytesMut) -> Result<()>
fn pack(&self, writer: &mut BytesMut) -> Result<()>
Pack the value into the given buffer without schema evolution support.
This method stores data in a compact format without field IDs or type tags. The format is not schema-evolution-friendly but offers better performance.
§Arguments
writer- The buffer to write the packed bytes into.