How obabec/rust-mqtt works
rust-mqtt is a no_std-oriented asynchronous MQTT 5 client library. Its user-controlled workflow is to configure and connect a Client over an async transport, then publish or subscribe, poll for protocol events and acknowledgements, and explicitly disconnect or recover a session after failure. The map separates client orchestration, protocol/session behavior, and transport and data primitives. README and source-index references support the shown links; unsampled packet and session internals are represented at their existing paths without asserting undocumented call chains.
Main entry points: client/mod.rs MQTT Client · raw/mod.rs Raw Connection · session/mod.rs Session Tracking · packet MQTT v5 Packets
Components 18
Client API
- MQTT Client
src/client/mod.rs - Action Options
src/client/options/mod.rs - Client Events
src/client/event.rs - Enhanced Auth
src/auth.rs - Client / Server Config
src/config/mod.rs
Protocol and Session
- Session Tracking
src/session/mod.rs - Session Handle
src/session/handle.rs - MQTT v5 Packets
src/v5/packet - Packet Framing
src/packet/rx.rs - Fixed Header
src/header.rs - MQTT Types
src/types/mod.rs - Topic Types
src/types/topic.rs
Runtime Foundations
- Async I/O
src/io/mod.rs - Raw Connection
src/client/raw/mod.rs - Buffer Provider
src/buffer.rs - Byte Storage
src/bytes.rs
Other components
- Application
- MQTT Broker
Connections 18
- Application → MQTT Client: uses
README.md - Application → Action Options: configures
README.md - MQTT Client → Action Options: accepts
src/client/mod.rs - MQTT Client → Client / Server Config: enforces
src/client/mod.rs - MQTT Client → Raw Connection: delegates I/O
src/client/mod.rs - Raw Connection → Async I/O: uses transport
- Raw Connection → Buffer Provider: provisions
src/client/raw/mod.rs - Buffer Provider → Byte Storage: provides storage
src/buffer.rs - MQTT Client → Session Tracking: tracks protocol state
- Session Tracking → Session Handle: uses
src/session/mod.rs - MQTT Client → Client Events: returns events
src/client/mod.rs - MQTT Client → Enhanced Auth: supports exchanges
src/auth.rs - MQTT Client → MQTT v5 Packets: encodes protocol
- Raw Connection → Packet Framing: receives packets
src/client/raw/mod.rs - Packet Framing → Fixed Header: uses header
src/packet/rx.rs - MQTT v5 Packets → MQTT Types: uses values
- Topic Types → MQTT Types: exports through
src/types/mod.rs - MQTT Client → MQTT Broker: exchanges MQTT
README.md