pub struct StringPairData(/* private fields */);Expand description
A UTF-8 String Pair consists of two UTF-8 Encoded Strings.
This data type is used to hold name-value pairs. The first string serves as the name, and the second string contains the value.
Both strings MUST comply with the requirements for UTF-8 Encoded Strings [MQTT-1.5.7-1]. If a receiver (Client or Server) receives a string pair which does not meet these requirements it is a Malformed Packet.
+----------------------+
| Key Length |
| |
+----------------------+
| Key characters |
| |
+----------------------+
| Value Length |
| |
+----------------------+
| Value characters |
| |
+----------------------+Implementations§
Source§impl StringPairData
impl StringPairData
Sourcepub const fn key(&self) -> &StringData
pub const fn key(&self) -> &StringData
Get key in pair.
Sourcepub const fn value(&self) -> &StringData
pub const fn value(&self) -> &StringData
Get string value in pari.
Trait Implementations§
Source§impl Clone for StringPairData
impl Clone for StringPairData
Source§fn clone(&self) -> StringPairData
fn clone(&self) -> StringPairData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StringPairData
impl Debug for StringPairData
Source§impl DecodePacket for StringPairData
impl DecodePacket for StringPairData
Source§impl Default for StringPairData
impl Default for StringPairData
Source§fn default() -> StringPairData
fn default() -> StringPairData
Returns the “default value” for a type. Read more
Source§impl Display for StringPairData
impl Display for StringPairData
Source§impl EncodePacket for StringPairData
impl EncodePacket for StringPairData
Source§impl PartialEq for StringPairData
impl PartialEq for StringPairData
impl Eq for StringPairData
impl StructuralPartialEq for StringPairData
Auto Trait Implementations§
impl Freeze for StringPairData
impl RefUnwindSafe for StringPairData
impl Send for StringPairData
impl Sync for StringPairData
impl Unpin for StringPairData
impl UnwindSafe for StringPairData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more