Crate mymq

Source
Expand description

Package implement message queue broker based on MQTT protocol.

Currently implements MQTT-v5 broker and a corresponding client. Based on popular demand other message-queue protocols shall be integrated into this broker.

§Features

broker, enabled by default, provides all the necessary items needed to build a MQTT broker application. Enabling broker, will automatically enable client.

client, enabled by default, provides all the necessary items needed to build an MQTT client. Application that doesn’t require a broker can disable default features via --no-default-features in cmd-line or via default-features = false in dependency declaration.

backtrace, is library feature that captures backtrace at the point where error is detected by this libarary. Additionally if logging is enabled backtace is logged as per the configured log-backend.

fuzzy, is used only by the test infrastructure. Typical application won’t have a need for this. Enabling this will provide arbitrary::Arbitrary implementation for several types defined in this library.

By default broker and client features are enabled.

§Rust unstable features
§Binary artifacts
  • mymqd, daemon program to start the server and manage the mymq deployment.

Modules§

broker
Broker implementation. Overview of broker design.
util
Helper functions.
v5
Module can speak MQTT Version-5 protocol.

Macros§

config_field
err
Macro to compose Error values.

Structs§

ClientID
Type client-id implements a unique ID, managed internally as string.
Config
Configuration for broker and supported protocols.
Error
Type Error implement all possible error-values that can be returned by the Result type.
F32
PacketRx
Type implement the rx-handle for a packet-queue.
PacketTx
Type implement the tx-handle for a packet-queue.
Subscription
Type captures an active subscription by client.
Timer
Differential Timer, to add timers for messages, sessions etc and manage expiry.
TopicFilter
Type implement topic-filter defined by MQTT specification.
TopicName
Type implement topic-name defined by MQTT specification.
VarU32
Type implement variable-length unsigned 32-bit integer.

Enums§

Blob
Type is associated with Packetize trait and optimizes on the returned byte-blob.
ErrorKind
Error kind expected to be handled by calling functions.
PacketType
MQTT packet type
Protocol
Enumerated list of supported message-queue protocol.
QPacket
Enumerated types of packets supported by protocol.
QoS
Quality of service
QueueStatus
Return type from methods used to send or receive messages/packets/commands.
ReasonCode
ReasonCode defined by each variant defines error value.
RetainForwardRule
RetainForwardRule part of Subscription option defined by MQTT spec.
Socket

Constants§

SLEEP_10MS
Used by threads to sleep wait for an event to accur..

Traits§

IterTopicPath
Trait implemented by TopicName and TopicFilter.
Packetize
Trait, to serialize data, implemented by types that participate in protocol framing.
ToJson
Trait that returns Jsonified strings.

Functions§

new_packet_queue
Create a packet-queue for shard/miot that can hold upto size packets.

Type Aliases§

PacketID
Type alias for PacketID as u16.
Result
Type alias for Result returned by functions and methods defined in this package.