pub trait EncodeMessage {
    const WIRE_TYPE: WireType;

    fn is_default(&self) -> bool;
    fn encoded_size(
        &mut self,
        field: Option<FieldOpt>,
        builder: &mut SizeBuilder
    ) -> Result<(), EncodeError>; fn encode<B>(
        &mut self,
        field: Option<FieldOpt>,
        encoder: &mut MessageEncoder<B>
    ) -> Result<(), EncodeError>
    where
        B: BytesWrite
; fn write_to_bytes(&mut self) -> Result<Vec<u8>, EncodeError> { ... } }
Expand description

Ignoring fields

if your call tells you a field number you need to write it even if you have the default value

You can only ignore writing fields if you wan’t

Required Associated Constants§

at the moment only used to check if this message can be packed

Required Methods§

how big will the size be after encoding

The that get’s returned here needs to be the same as called in write

if fieldnum is set this means you need to write the tag

In most cases before this is called encoded_size get’s called

The size that get’s computed in encoded_size must be the same as we get here

if fieldnum is set this means you need to write the tag to

Provided Methods§

Implementations on Foreign Types§

how big will the size be after writing

how big will the size be after writing

how big will the size be after writing

how big will the size be after writing

how big will the size be after writing

how big will the size be after writing

how big will the size be after writing

Implementors§