encode

Function encode 

pub(super) const fn encode<P: PropertyConstraint>(
    packet_id: PacketId,
    properties: &Properties<P>,
    payload: &[u8],
    w: &mut Writer<'_>,
) -> Result<(), EncodeError>
Expand description

Encodes a “packet id + properties + payload” body into the writer.

§Errors

Returns EncodeError::InsufficientSpace if the writer does not have enough capacity.