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 moresource§impl Debug for TxtProperties
impl Debug for TxtProperties
source§impl Display for TxtProperties
impl Display for TxtProperties
source§impl PartialEq for TxtProperties
impl PartialEq for TxtProperties
impl Eq for TxtProperties
impl StructuralPartialEq for TxtProperties
Auto Trait Implementations§
impl Freeze for TxtProperties
impl RefUnwindSafe for TxtProperties
impl Send for TxtProperties
impl Sync for TxtProperties
impl Unpin for TxtProperties
impl UnwindSafe for TxtProperties
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)