Struct mdns_sd::TxtProperties
source · pub struct TxtProperties { /* private fields */ }Expand description
Represents properties in a TXT record.
The key string of a property is case insensitive, and only
one TxtProperty is stored for the same key.
RFC 6763: “A given key SHOULD NOT appear more than once in a TXT record.”
Implementations§
source§impl TxtProperties
impl TxtProperties
sourcepub fn iter(&self) -> impl Iterator<Item = &TxtProperty>
pub fn iter(&self) -> impl Iterator<Item = &TxtProperty>
Returns an iterator for all properties.
sourcepub fn get(&self, key: &str) -> Option<&TxtProperty>
pub fn get(&self, key: &str) -> Option<&TxtProperty>
Returns a property for a given key, where key is
case insensitive.
sourcepub fn get_property_val(&self, key: &str) -> Option<Option<&[u8]>>
pub fn get_property_val(&self, key: &str) -> Option<Option<&[u8]>>
Returns a property value for a given key, where key is
case insensitive.
Returns None if key does not exist.
Returns Some(Option<&u8>) for its value.
sourcepub fn get_property_val_str(&self, key: &str) -> Option<&str>
pub fn get_property_val_str(&self, key: &str) -> Option<&str>
Returns a property value string for a given key, where key is
case insensitive.
Returns None if key does not exist.
Returns Some("") if its value is None or is empty.
Trait Implementations§
source§impl Clone for TxtProperties
impl Clone for TxtProperties
source§fn clone(&self) -> TxtProperties
fn clone(&self) -> TxtProperties
Returns a copy 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 more