Skip to main content

encode_publish

Function encode_publish 

fn encode_publish<B, A>(
    out: &mut PacketWriter<B>,
    aliases: &mut A,
    caps: &ServerCapabilities,
    delivery: Delivery,
    retain: bool,
    topic: &Topic,
    properties: &PublishProperties,
    payload: &Payload,
) -> Result<(), PublishFailure<B::Error, A::Error>>
Expand description

Resolves the topic alias for a publish, enforces the server’s limits, and encodes it into out. This is the only place where an outgoing PUBLISH is built, shared by the session drain and the QoS 0 path. A New alias is released again if the packet is not written, so a dropped publish does not leave a phantom mapping.