Registry / messaging / mqtt-async-client

mqtt-async-client

JSON →
library0.3.1rscratesunverified

An MQTT 3.1.1 client written in Rust, using async functions and tokio.

# Cargo.toml [dependencies] mqtt-async-client = "0.3.1"
INSTALL
IMPORT
SIG · MQTT-ASYNC-CLIENT
M
mqtt-async-client
messagingrustv0.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
use mqtt_async_client::Client;

Connects to an MQTT broker and publishes a message

use mqtt_async_client::Client; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { let mut client = Client::new("tcp://localhost:1883")?; client.connect().await?; client.publish("test", b"hello").await?; Ok(()) }
Debug
Known issues
gotchaRequires tokio runtime
fix
Use #[tokio::main] or manually create a tokio runtime
affects: >=0.1.0
Upgrade
Version history
0.3.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
29 hits · last 30 days
node
26
OpenAI (training)
1
Resources
mqtt-async-client — cargo add mqtt-async-client · libregistry