Skip to main content

Crate finmqtt_client

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.
tokiotokio
Session-oriented MQTT v5 client built on [tokio].

Structs§

Client
State machine for a sans-io MQTT v5 client.
HandleOutcome
Result of processing an incoming packet.
OutgoingPublish
A QoS > 0 publish handed to the drain_outbox callback to be put on the wire.
ServerCapabilities
Server capabilities extracted from CONNACK properties (§3.2.2.3).

Enums§

AliasDecision
What to do with the topic alias for an outgoing PUBLISH (§3.3.2.3.4).
ClientError
Errors from the client state machine.
ClientEvent
Events produced by the client state machine for the application layer.
ConnectionState
Connection lifecycle phase.
DrainError
Error returned by Client::poll_transmit. The session keeps the packets not yet written for the next call.
HandleError
Error from Client::handle_packet.
Response
A response packet that the caller must encode and send to the server.
StoreError
Error from a Client method that stores data in the session.
TransmitError
Error returned by Client::transmit_qos0.
TransmitEvent
An outcome of Client::poll_transmit the 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§

InboundAliasTable
The topic aliases the server established on the current connection (§3.3.2.3.4).
OutboundAliasTable
Per-connection outbound topic-alias assignment.