pub struct DnsTxt { /* private fields */ }Expand description
Resource Record for a DNS TXT record.
From [RFC 6763 section 6]:
The format of each constituent string within the DNS TXT record is a single length byte, followed by 0-255 bytes of text data.
DNS-SD uses DNS TXT records to store arbitrary key/value pairs conveying additional information about the named service. Each key/value pair is encoded as its own constituent string within the DNS TXT record, in the form “key=value” (without the quotation marks). Everything up to the first ‘=’ character is the key (Section 6.4). Everything after the first ‘=’ character to the end of the string (including subsequent ‘=’ characters, if any) is the value
Implementations§
Trait Implementations§
Source§impl DnsRecordExt for DnsTxt
impl DnsRecordExt for DnsTxt
fn get_record(&self) -> &DnsRecord
fn get_record_mut(&mut self) -> &mut DnsRecord
fn write(&self, packet: &mut DnsOutPacket)
fn any(&self) -> &dyn Any
Source§fn matches(&self, other: &dyn DnsRecordExt) -> bool
fn matches(&self, other: &dyn DnsRecordExt) -> bool
Returns whether
other record is considered the same except TTL.Source§fn rrdata_match(&self, other: &dyn DnsRecordExt) -> bool
fn rrdata_match(&self, other: &dyn DnsRecordExt) -> bool
Returns whether
other record has the same rdata.Source§fn compare_rdata(&self, other: &dyn DnsRecordExt) -> Ordering
fn compare_rdata(&self, other: &dyn DnsRecordExt) -> Ordering
Returns the result based on a byte-level comparison of
rdata.
If other is not valid, returns Greater.Source§fn rdata_print(&self) -> String
fn rdata_print(&self) -> String
Returns a human-readable string of rdata.
fn clone_box(&self) -> DnsRecordBox
Source§fn compare(&self, other: &dyn DnsRecordExt) -> Ordering
fn compare(&self, other: &dyn DnsRecordExt) -> Ordering
Returns the result based on “lexicographically later” defined below.
fn get_cache_flush(&self) -> bool
Source§fn get_name(&self) -> &str
fn get_name(&self) -> &str
Return the new name if exists, otherwise the regular name in DnsEntry.
fn get_type(&self) -> RRType
Source§fn reset_ttl(&mut self, other: &dyn DnsRecordExt)
fn reset_ttl(&mut self, other: &dyn DnsRecordExt)
Resets TTL using
other record.
self.refresh and self.expires are also reset.fn get_created(&self) -> u64
fn get_expire(&self) -> u64
fn set_expire(&mut self, expire_at: u64)
Source§fn set_expire_sooner(&mut self, expire_at: u64)
fn set_expire_sooner(&mut self, expire_at: u64)
Set expire as
expire_at if it is sooner than the current expire.Source§fn updated_refresh_time(&mut self, now: u64) -> Option<u64>
fn updated_refresh_time(&mut self, now: u64) -> Option<u64>
Given
now, if the record is due to refresh, this method updates the refresh time
and returns the new refresh time. Otherwise, returns None.Source§fn suppressed_by_answer(&self, other: &dyn DnsRecordExt) -> bool
fn suppressed_by_answer(&self, other: &dyn DnsRecordExt) -> bool
Returns true if another record has matched content,
and if its TTL is at least half of this record’s.
Source§fn suppressed_by(&self, msg: &DnsIncoming) -> bool
fn suppressed_by(&self, msg: &DnsIncoming) -> bool
Required by RFC 6762 Section 7.1: Known-Answer Suppression.
Auto Trait Implementations§
impl Freeze for DnsTxt
impl RefUnwindSafe for DnsTxt
impl Send for DnsTxt
impl Sync for DnsTxt
impl Unpin for DnsTxt
impl UnwindSafe for DnsTxt
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