pub trait PropertiesParse {
// Required method
fn parse(data: &[u8]) -> Result<(Self, usize), MqttError>
where Self: Sized;
}
Expand description
Trait for parsing properties collection from byte data
This trait provides functionality to parse a collection of MQTT properties from a byte buffer according to the MQTT v5.0 specification format.
Required Methods§
Sourcefn parse(data: &[u8]) -> Result<(Self, usize), MqttError>where
Self: Sized,
fn parse(data: &[u8]) -> Result<(Self, usize), MqttError>where
Self: Sized,
Parse properties collection from byte data
Parses properties from a byte buffer that contains a variable-length integer indicating the properties length, followed by the encoded properties.
§Parameters
data
- Byte buffer containing the encoded properties data
§Returns
Ok((Properties, bytes_consumed))
- Successfully parsed properties and bytes consumedErr(MqttError)
- If the buffer is malformed or contains invalid property data
Implementors§
impl PropertiesParse for Properties
Implementation of PropertiesParse for Properties
Parses properties according to MQTT v5.0 specification format:
- Variable-length integer indicating properties length
- Sequence of encoded properties