pub struct Builder {Show 33 fields
pub name: String,
pub laddr: SocketAddr,
pub backlog: i32,
pub nodelay: bool,
pub reuseaddr: Option<bool>,
pub reuseport: Option<bool>,
pub max_connections: usize,
pub max_handshaking_limit: usize,
pub max_packet_size: u32,
pub allow_anonymous: bool,
pub min_keepalive: u16,
pub max_keepalive: u16,
pub allow_zero_keepalive: bool,
pub keepalive_backoff: f32,
pub max_inflight: NonZeroU16,
pub handshake_timeout: Duration,
pub send_timeout: Duration,
pub max_mqueue_len: usize,
pub mqueue_rate_limit: (NonZeroU32, Duration),
pub max_clientid_len: usize,
pub max_qos_allowed: QoS,
pub max_topic_levels: usize,
pub session_expiry_interval: Duration,
pub message_retry_interval: Duration,
pub message_expiry_interval: Duration,
pub max_subscriptions: usize,
pub shared_subscription: bool,
pub max_topic_aliases: u16,
pub limit_subscription: bool,
pub delayed_publish: bool,
pub tls_cross_certificate: bool,
pub tls_cert: Option<String>,
pub tls_key: Option<String>,
}
Expand description
Server configuration and listener management Configuration builder for MQTT server instances
Fields§
§name: String
Server identifier for logging and monitoring
laddr: SocketAddr
Network address to listen on
backlog: i32
Maximum number of pending connections in the accept queue
nodelay: bool
Enable TCP_NODELAY option for lower latency
reuseaddr: Option<bool>
Set SO_REUSEADDR socket option
reuseport: Option<bool>
Set SO_REUSEPORT socket option
max_connections: usize
Maximum concurrent active connections
max_handshaking_limit: usize
Maximum simultaneous handshakes during connection setup
max_packet_size: u32
Maximum allowed MQTT packet size in bytes (0 = unlimited)
allow_anonymous: bool
Allow unauthenticated client connections
min_keepalive: u16
Minimum acceptable keepalive value in seconds
max_keepalive: u16
Maximum acceptable keepalive value in seconds
allow_zero_keepalive: bool
Allow clients to disable keepalive mechanism
keepalive_backoff: f32
Multiplier for calculating actual keepalive timeout
max_inflight: NonZeroU16
Window size for unacknowledged QoS 1/2 messages
handshake_timeout: Duration
Timeout for completing connection handshake
send_timeout: Duration
Network I/O timeout for sending operations
max_mqueue_len: usize
Maximum messages queued per client
mqueue_rate_limit: (NonZeroU32, Duration)
Rate limiting for message delivery (messages per duration)
max_clientid_len: usize
Maximum length of client identifiers
max_qos_allowed: QoS
Highest QoS level permitted for publishing
max_topic_levels: usize
Maximum depth for topic hierarchy (0 = unlimited)
session_expiry_interval: Duration
Duration before inactive sessions expire
message_retry_interval: Duration
Retry interval for unacknowledged messages
message_expiry_interval: Duration
Time-to-live for undelivered messages
max_subscriptions: usize
Maximum subscriptions per client (0 = unlimited)
Enable shared subscription support
max_topic_aliases: u16
Maximum topic aliases (MQTTv5 feature)
limit_subscription: bool
Enable subscription count limiting
delayed_publish: bool
Enable future-dated message publishing
tls_cross_certificate: bool
Enable mutual TLS authentication
tls_cert: Option<String>
Path to TLS certificate chain
tls_key: Option<String>
Path to TLS private key
Implementations§
Source§impl Builder
§Examples
use std::net::SocketAddr;
use rmqtt_net::Builder;
let builder = Builder::new()
.name("EdgeBroker")
.laddr("127.0.0.1:1883".parse().unwrap())
.max_connections(10_000);
impl Builder
§Examples
use std::net::SocketAddr;
use rmqtt_net::Builder;
let builder = Builder::new()
.name("EdgeBroker")
.laddr("127.0.0.1:1883".parse().unwrap())
.max_connections(10_000);
Sourcepub fn laddr(self, laddr: SocketAddr) -> Self
pub fn laddr(self, laddr: SocketAddr) -> Self
Configures the network listen address
Sourcepub fn max_connections(self, max_connections: usize) -> Self
pub fn max_connections(self, max_connections: usize) -> Self
Sets maximum concurrent connections
Sourcepub fn max_handshaking_limit(self, max_handshaking_limit: usize) -> Self
pub fn max_handshaking_limit(self, max_handshaking_limit: usize) -> Self
Sets maximum concurrent handshakes
Sourcepub fn max_packet_size(self, max_packet_size: u32) -> Self
pub fn max_packet_size(self, max_packet_size: u32) -> Self
Configures maximum MQTT packet size
Sourcepub fn allow_anonymous(self, allow_anonymous: bool) -> Self
pub fn allow_anonymous(self, allow_anonymous: bool) -> Self
Enables anonymous client access
Sourcepub fn min_keepalive(self, min_keepalive: u16) -> Self
pub fn min_keepalive(self, min_keepalive: u16) -> Self
Sets minimum acceptable keepalive value
Sourcepub fn max_keepalive(self, max_keepalive: u16) -> Self
pub fn max_keepalive(self, max_keepalive: u16) -> Self
Sets maximum acceptable keepalive value
Sourcepub fn allow_zero_keepalive(self, allow_zero_keepalive: bool) -> Self
pub fn allow_zero_keepalive(self, allow_zero_keepalive: bool) -> Self
Allows clients to disable keepalive
Sourcepub fn keepalive_backoff(self, keepalive_backoff: f32) -> Self
pub fn keepalive_backoff(self, keepalive_backoff: f32) -> Self
Configures keepalive backoff multiplier
Sourcepub fn max_inflight(self, max_inflight: NonZeroU16) -> Self
pub fn max_inflight(self, max_inflight: NonZeroU16) -> Self
Sets inflight message window size
Sourcepub fn handshake_timeout(self, handshake_timeout: Duration) -> Self
pub fn handshake_timeout(self, handshake_timeout: Duration) -> Self
Configures handshake timeout duration
Sourcepub fn send_timeout(self, send_timeout: Duration) -> Self
pub fn send_timeout(self, send_timeout: Duration) -> Self
Sets network send timeout duration
Sourcepub fn max_mqueue_len(self, max_mqueue_len: usize) -> Self
pub fn max_mqueue_len(self, max_mqueue_len: usize) -> Self
Configures maximum message queue length
Sourcepub fn mqueue_rate_limit(
self,
rate_limit: NonZeroU32,
duration: Duration,
) -> Self
pub fn mqueue_rate_limit( self, rate_limit: NonZeroU32, duration: Duration, ) -> Self
Sets message rate limiting parameters
Sourcepub fn max_clientid_len(self, max_clientid_len: usize) -> Self
pub fn max_clientid_len(self, max_clientid_len: usize) -> Self
Sets maximum client ID length
Sourcepub fn max_qos_allowed(self, max_qos_allowed: QoS) -> Self
pub fn max_qos_allowed(self, max_qos_allowed: QoS) -> Self
Configures maximum allowed QoS level
Sourcepub fn max_topic_levels(self, max_topic_levels: usize) -> Self
pub fn max_topic_levels(self, max_topic_levels: usize) -> Self
Sets maximum topic hierarchy depth
Sourcepub fn session_expiry_interval(self, session_expiry_interval: Duration) -> Self
pub fn session_expiry_interval(self, session_expiry_interval: Duration) -> Self
Configures session expiration interval
Sourcepub fn message_retry_interval(self, message_retry_interval: Duration) -> Self
pub fn message_retry_interval(self, message_retry_interval: Duration) -> Self
Sets message retry interval for QoS 1/2
Sourcepub fn message_expiry_interval(self, message_expiry_interval: Duration) -> Self
pub fn message_expiry_interval(self, message_expiry_interval: Duration) -> Self
Configures message expiration time
Sourcepub fn max_subscriptions(self, max_subscriptions: usize) -> Self
pub fn max_subscriptions(self, max_subscriptions: usize) -> Self
Sets maximum subscriptions per client
Enables shared subscription support
Sourcepub fn max_topic_aliases(self, max_topic_aliases: u16) -> Self
pub fn max_topic_aliases(self, max_topic_aliases: u16) -> Self
Configures maximum topic aliases (MQTTv5)
Sourcepub fn limit_subscription(self, limit_subscription: bool) -> Self
pub fn limit_subscription(self, limit_subscription: bool) -> Self
Enables subscription count limiting
Sourcepub fn delayed_publish(self, delayed_publish: bool) -> Self
pub fn delayed_publish(self, delayed_publish: bool) -> Self
Enables delayed message publishing
Sourcepub fn tls_cross_certificate(self, cross_certificate: bool) -> Self
pub fn tls_cross_certificate(self, cross_certificate: bool) -> Self
Enables mutual TLS authentication