Trait zeroconf::txt_record::TTxtRecord [−][src]
pub trait TTxtRecord: Clone + PartialEq + Eq { fn new() -> Self; fn insert(&mut self, key: &str, value: &str) -> Result<()>; fn get(&self, key: &str) -> Option<String>; fn remove(&mut self, key: &str) -> Result<()>; fn contains_key(&self, key: &str) -> bool; fn len(&self) -> usize; fn iter<'a>(&'a self) -> Box<dyn Iterator<Item = (String, String)> + 'a>; fn keys<'a>(&'a self) -> Box<dyn Iterator<Item = String> + 'a>; fn values<'a>(&'a self) -> Box<dyn Iterator<Item = String> + 'a>; fn is_empty(&self) -> bool { ... } fn to_map(&self) -> HashMap<String, String> { ... } }
Expand description
Interface for interacting with underlying mDNS implementation TXT record capabilities
Required methods
Inserts the specified value at the specified key.
Returns the value at the specified key or None
if no such key exists.
This function returns an owned String
because there are no guarantees that the
implementation provides access to the underlying value pointer.
Removes the value at the specified key. Returns Err
if no such key exists.
fn contains_key(&self, key: &str) -> bool
fn contains_key(&self, key: &str) -> bool
Returns true if the TXT record contains the specified key.
Returns a new iterator for iterating over the record as you would a HashMap
.
Returns a new iterator over the records keys.