Crate rmqtt_net

Source
Expand description

Basic Implementation of MQTT Server

The basic implementation of MQTT proxy, supporting v3.1.1 and v5.0 protocols, with TLS and WebSocket functionality.

§Basic Usage

use rmqtt_net::{Builder, ListenerType};
use std::net::SocketAddr;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let builder = Builder::new()
        .name("MyBroker")
        .laddr("127.0.0.1:1883".parse()?);

    let listener = builder.bind()?;
    loop {
        let acceptor = listener.accept().await?;
        let dispatcher = acceptor.tcp()?;
        // Handle connection...
    }
    Ok(())
}

Re-exports§

pub use rustls;

Modules§

tls_provider
AWS-LC based TLS provider (non-Windows platforms) aws-lc-rs-based CryptoProvider.
v3
MQTT protocol implementations and stream handling
v5
MQTT protocol implementations and stream handling

Structs§

Builder
Server configuration and listener management Configuration builder for MQTT server instances
Listener
Server configuration and listener management Network listener for accepting client connections

Enums§

ListenerType
Server configuration and listener management Protocol variants for network listeners
MqttError
Error types for MQTT operations
MqttStream
MQTT protocol implementations and stream handling Version-specific MQTT protocol streams

Type Aliases§

Error
Convenience type alias for generic errors
Result
Result type alias using crate’s Error type