Expand description
mqtt-broker — an MQTT 3.1.1 / MQTT 5.0 broker written in Rust,
exposed to other languages via UniFFI.
Reuses the wire-protocol codec from the mqtt-client crate
(mqtt_client::protocol) rather than duplicating it — this workspace
intentionally has no separate “core” crate; the client crate’s codec
doubles as the shared foundation for both binaries.
Structs§
- Auth
Request - One CONNECT awaiting an allow/deny decision.
- Broker
TlsConfig - TLS configuration for
MqttBrokerConfig::tls. All certificate/key material is PEM-encoded bytes (not file paths), matchingmqtt_client::TlsOptionsso this works identically across every language binding without assuming a filesystem layout. - Enhanced
Auth Step - What the broker should do after one authentication round — a record (outcome + payload) rather than an enum-with-data, because several binding generators mishandle callbacks that return data-carrying enums.
- Mqtt
Broker - A running (or not-yet-started) MQTT broker instance, speaking both MQTT 3.1.1 and MQTT 5.0 — the protocol version is negotiated independently per connection from each client’s CONNECT packet.
- Mqtt
Broker Config - Configuration for an
crate::broker::MqttBroker.
Enums§
- Broker
Event - A broker event, as returned by the pull-style
MqttBroker::next_event(the polling twin ofMqttBrokerEventListener). - Enhanced
Auth Outcome - The verdict of one round of an MQTT 5.0 enhanced authentication exchange.
- Mqtt
Broker Error - Errors produced while starting or stopping an
crate::MqttBroker. - QoS
- MQTT Quality of Service level, as used in the broker’s own API
(
MqttBrokerConfig::max_qos,MqttBrokerEventListener,crate::BrokerEvent).
Constants§
- DEFAULT_
MAX_ OUTBOUND_ QUEUE - Default number of encoded packets that may be queued for one client’s
socket before further deliveries to it are dropped (see
MqttBrokerConfig::max_outbound_queue). - DEFAULT_
MAX_ PACKET_ SIZE - Default cap on a single inbound packet (fixed header + body): 1 MiB. An unauthenticated peer can announce any size up to the protocol’s ~256 MiB maximum; without a cap each connection could force that much buffering.
Traits§
- Mqtt
Auth Provider - Pluggable authentication, evaluated once per CONNECT.
- Mqtt
Broker Event Listener - Broker-side view of a delivered/observed event, for monitoring and logging from foreign code.
- Mqtt
Enhanced Auth Provider - Pluggable MQTT 5.0 enhanced authentication (SCRAM, Kerberos, OAuth, …):
a multi-round challenge/response evaluated during CONNECT, before the
session is attached. A CONNECT naming an
Authentication Methodis refused unless a provider is registered.
Type Aliases§
- Mqtt
Broker Result - Convenience alias for broker lifecycle operations.