pub enum ReadData<'a> {
Ptr(Name),
Srv {
port: u16,
target: Name,
},
Txt(&'a [u8]),
Aaaa([u8; 16]),
A([u8; 4]),
}Expand description
The decoded RDATA of a read record.
Variants§
Ptr(Name)
PTR — the target name, decompressed.
Srv
SRV — the port and the target host, decompressed.
Txt(&'a [u8])
TXT — the raw key/value strings, to be read with
TxtReader.
Aaaa([u8; 16])
AAAA — an IPv6 address.
A([u8; 4])
A — an IPv4 address. Matter “does not use IPv4”; a reader still has to step over one.
Implementations§
Source§impl ReadData<'_>
impl ReadData<'_>
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, the form RFC 6762 §8.2’s tiebreak compares.
The mirror of RecordData::write_rdata, for a record that arrived on the wire: the
names here were decompressed on decode, so this re-serialises them in the canonical
form both sides of a tiebreak must be in.
RDATA_MAX is always enough.
Trait Implementations§
impl<'a> Eq for ReadData<'a>
impl<'a> StructuralPartialEq for ReadData<'a>
Auto Trait Implementations§
impl<'a> Forget for ReadData<'a>
impl<'a> Freeze for ReadData<'a>
impl<'a> Move for ReadData<'a>
impl<'a> RefUnwindSafe for ReadData<'a>
impl<'a> Send for ReadData<'a>
impl<'a> Sync for ReadData<'a>
impl<'a> Unpin for ReadData<'a>
impl<'a> UnsafeUnpin for ReadData<'a>
impl<'a> UnwindSafe for ReadData<'a>
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