pub enum RecordData<'a> {
Ptr(&'a [&'a str]),
Srv {
port: u16,
target: &'a [&'a str],
},
Txt(&'a [u8]),
Aaaa([u8; 16]),
A([u8; 4]),
}Expand description
The RDATA of the record types Matter’s DNS-SD uses.
Variants§
Ptr(&'a [&'a str])
PTR — a target name.
Srv
SRV — priority, weight, port, target. Matter always uses priority 0 and weight 0.
Fields
Txt(&'a [u8])
TXT — the encoded key/value strings.
Aaaa([u8; 16])
AAAA — a 128-bit address.
A([u8; 4])
A — a 32-bit address. Matter never publishes one; it is here so a reader can skip it.
Implementations§
Source§impl RecordData<'_>
impl RecordData<'_>
Sourcepub fn write_rdata<'b>(&self, buf: &'b mut [u8]) -> Result<&'b [u8]>
pub fn write_rdata<'b>(&self, buf: &'b mut [u8]) -> Result<&'b [u8]>
Writes the RDATA uncompressed, as RFC 6762 §8.2’s tiebreak compares it.
“In the case of resource records containing rdata that is subject to name compression, the names MUST be uncompressed before comparison. (The details of how a particular name is compressed is an artifact of how and where the record is written into the DNS message; it is not an intrinsic property of the resource record itself.)” Comparing the bytes as they appear in a message would make the winner depend on which record happened to be written first.
RDATA_MAX is always enough.
Sourcepub const fn kind(&self) -> RecordType
pub const fn kind(&self) -> RecordType
The record type this data belongs to.