Skip to main content

encode

Function encode 

pub(super) fn encode<P: Constraint, S: Sink>(
    packet_id: PacketId,
    properties: &Properties<P>,
    payload: &[u8],
    w: &mut Writer<S>,
) -> Result<(), S::Error>
Expand description

Encodes a SUBSCRIBE, UNSUBSCRIBE, SUBACK or UNSUBACK body into the writer.

§Errors

Returns the sink’s error if it cannot take the bytes.