[][src]Crate sage_mqtt

sage_mqtt is a set of traits and

Structs

BinaryData

Binary Data is represented by a Two Byte Integer length which indicates the number of data bytes, followed by that number of bytes. Thus, the length of Binary Data is limited to the range of 0 to 65,535 Bytes.

Bits

Bits in a byte are labelled 7 to 0. Bit number 7 is the most significant bit.

FourByteInteger

Four bytes data values are 32-bits unsigned integer represented in big-endian. That means the most significant byte (MSB) is presented first on the stream.

TwoByteInteger

Two bytes data values are 16-bits unsigned integer represented in big-endian. That means the most significant byte (MSB) is presented first on the stream.

UTF8String

Text fields in an MQTT paquet are described in UTF-8. Each string in the stream is prefixed with a two-byte size information with MSB first. Because of that, a string cannot be longer that 65,535 bytes.

Enums

VariableByteInteger

The Variable Byte Integer is encoded using an encoding scheme which uses a single byte for values up to 127. Larger values are handled as follows. The least significant seven bits of each byte encode the data, and the most significant bit is used to indicate whether there are bytes following in the representation. Thus, each byte encodes 128 values and a "continuation bit". The maximum number of bytes in the Variable Byte Integer field is four.

Traits

Encode

The Encode trait describes how to write a type into an MQTT stream.