pub trait BuffaEncodeField {
// Required method
fn buffa_encode_field(&self, number: u32, buf: &mut BytesMut);
}Expand description
Encode a single struct field as a buffa wire-format tag + value
pair, using proto3’s “skip default” semantics.
One impl per supported scalar type. The derive macro emits one
self.field.buffa_encode_field(N, buf) call per field; the trait
dispatch picks the right wire-format helper at compile time, so
the macro does not need to introspect the field’s syntactic type.
Required Methods§
Sourcefn buffa_encode_field(&self, number: u32, buf: &mut BytesMut)
fn buffa_encode_field(&self, number: u32, buf: &mut BytesMut)
Encode self under proto field number number. Implementations
must skip emitting any bytes when self equals the proto3
default for the type (empty string, zero integer, false, …) so
the wire shape matches buffa::Message::write_to.