Skip to main content

ReadData

Enum ReadData 

Source
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.

Fields

§port: u16

The advertised port.

§target: Name

The target host name.

§

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<'_>

Source

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§

Source§

impl<'a> Clone for ReadData<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for ReadData<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Eq for ReadData<'a>

Source§

impl<'a> PartialEq for ReadData<'a>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.