Crate finmqtt_client
Expand description
MQTT v5 client: a sans-io, no_std state machine with an optional tokio
driver.
Client tracks the connection lifecycle, the limits the server
negotiated, packet identifiers and QoS 1 and 2 flows. It keeps its state
in a session::State. It doesn’t decode packets or perform I/O. The
caller passes it packets decoded with finmqtt-core and sends what it
returns.
§Features
The default build is allocation-free. Enabling alloc adds the heap-backed
session implementations session::InMemory and
session::journal::JournaledSession. Enabling tokio adds the tokio
module, a client that runs the state machine on a TCP or TLS connection.
It needs std.
Modules§
- client 🔒
- Client state machine.
- session
- Session state storage.
- tokio
tokio - Session-oriented MQTT v5 client built on [
tokio].
Structs§
- Client
- State machine for a sans-io MQTT v5 client.
- Handle
Outcome - Result of processing an incoming packet.
- Outgoing
Publish - A
QoS> 0 publish handed to thedrain_outboxcallback to be put on the wire. - Server
Capabilities - Server capabilities extracted from CONNACK properties (§3.2.2.3).
Enums§
- Alias
Decision - What to do with the topic alias for an outgoing PUBLISH (§3.3.2.3.4).
- Client
Error - Errors from the client state machine.
- Client
Event - Events produced by the client state machine for the application layer.
- Connection
State - Connection lifecycle phase.
- Drain
Error - Error returned by
Client::poll_transmit. The session keeps the packets not yet written for the next call. - Handle
Error - Error from
Client::handle_packet. - Response
- A response packet that the caller must encode and send to the server.
- Store
Error - Error from a
Clientmethod that stores data in the session. - Transmit
Error - Error returned by
Client::transmit_qos0. - 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. - Unsupported
- An optional server capability (§3.2.2.3) that an operation needs but the server lacks.
Traits§
- Inbound
Alias Table - The topic aliases the server established on the current connection (§3.3.2.3.4).
- Outbound
Alias Table - Per-connection outbound topic-alias assignment.