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 implementation. Overview of broker design.
Helper functions.
Module can speak MQTT Version-5 protocol.

Macros

Macro to compose Error values.

Structs

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

Enums

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

Constants

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

Traits

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

Functions

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

Type Definitions

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