[][src]Struct mqtt_packet::Property

pub struct Property {
    pub values: BTreeMap<Identifier, DataType>,
}

A Property consists of an Identifier which defines its usage and data type, followed by a value.

2.2.2.2 Property

A Property consists of an Identifier which defines its usage and data type, followed by a value. The Identifier is encoded as a Variable Byte Integer. A Control Packet which contains an Identifier which is not valid for its packet type, or contains a value not of the specified data type, is a Malformed Packet. If received, use a CONNACK or DISCONNECT packet with Reason Code 0x81 (Malformed Packet). There is no significance in the order of Properties with different Identifiers.

Fields

values: BTreeMap<Identifier, DataType>

Methods

impl Property[src]

pub fn new<R: Read>(reader: &mut R) -> Result<Self, Error>[src]

Parse property identifiers and values from a reader.

pub fn generate(&self) -> Result<Vec<u8>, Error>[src]

Convert Property values into a byte vector.

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]