Module transmit
Expand description
The outbound transmit path: encoding pending session state onto the wire.
Client::poll_transmit is the single place outgoing SUBSCRIBE,
UNSUBSCRIBE, PUBLISH, and PUBREL packets are produced. It owns topic-alias
assignment (via a caller-supplied TopicAliasTable), Maximum Packet
Size enforcement, and encoding into a PacketWriter, so an I/O driver
only has to move the resulting bytes.
SUBSCRIBE/UNSUBSCRIBE payloads are encoded straight from the session’s pending-filter iterators in two passes (length, then bytes), so the drain stays allocation-free regardless of the session backend.
Enums§
- Alias
Decision - What to do with the topic alias for an outgoing PUBLISH (§3.3.2.3.4).
- Encoded 🔒
- Disposition of one
encode_publishattempt. - Transmit
Event - An outcome of
Client::poll_transmitthe caller must act on, reported per packet identifier so the driver can resolve the user-facing future.
Traits§
- Topic
Alias Table - Per-connection outbound topic-alias assignment.
Functions§
- encode_
publish 🔒 - Resolves the topic alias for a publish, enforces
max_packet_size, and encodes it intoout. The single place an outgoing PUBLISH is built, shared by the session drain and theQoS0 path. ANewalias is confirmed only once the packet is actually written, so a dropped publish leaves no phantom mapping. - encode_
subscribe 🔒 - Encodes one pending SUBSCRIBE group straight from the session’s iterator in two passes (length, then bytes), needing no intermediate buffer.
- encode_
unsubscribe 🔒 - Encodes one pending UNSUBSCRIBE group; see
encode_subscribe. - transmit_
qos0 - Encodes a
QoS0 (fire-and-forget) PUBLISH intoout. - write_
group 🔒 - Frames a SUBSCRIBE/UNSUBSCRIBE group and writes it in one piece: fixed
header (§3.8.1/§3.10.1 mandate flags
0b0010), packet id, properties section, then the caller’s payload.