Skip to main content

ReadRecord

Struct ReadRecord 

Source
pub struct ReadRecord<'a> {
    pub section: Section,
    pub class: u16,
    pub name: Name,
    pub kind: Option<RecordType>,
    pub ttl: u32,
    pub cache_flush: bool,
    pub data: Option<ReadData<'a>>,
}
Expand description

One resource record read from a message.

The RDATA is borrowed from the message, and a name inside it — a PTR’s target, an SRV’s host — has already been decompressed into a Name, because a pointer is meaningless once separated from the message it points into.

Fields§

§section: Section

Which section the record came from.

§class: u16

The record class, with RFC 6762 §10.2’s cache-flush bit masked off.

§8.2 compares “the record class (excluding the cache-flush bit …)” first, so the bit has to be gone before a comparison rather than after it.

§name: Name

The owner name.

§kind: Option<RecordType>

The record type, or None for one this crate does not model.

Not an error: “Nodes SHALL silently ignore TXT record keys that they do not recognize” is the same spirit as ignoring a record type, and a responder on the link may publish anything.

§ttl: u32

Seconds. Zero is RFC 6762 §10.1’s goodbye — “this record is going away”.

§cache_flush: bool

RFC 6762 §10.2’s cache-flush bit.

§data: Option<ReadData<'a>>

The decoded data, for the types this crate models.

Trait Implementations§

Source§

impl<'a> Clone for ReadRecord<'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 ReadRecord<'a>

Source§

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

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

impl<'a> Eq for ReadRecord<'a>

Source§

impl<'a> PartialEq for ReadRecord<'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 ReadRecord<'a>

Auto Trait Implementations§

§

impl<'a> Forget for ReadRecord<'a>

§

impl<'a> Freeze for ReadRecord<'a>

§

impl<'a> Move for ReadRecord<'a>

§

impl<'a> RefUnwindSafe for ReadRecord<'a>

§

impl<'a> Send for ReadRecord<'a>

§

impl<'a> Sync for ReadRecord<'a>

§

impl<'a> Unpin for ReadRecord<'a>

§

impl<'a> UnsafeUnpin for ReadRecord<'a>

§

impl<'a> UnwindSafe for ReadRecord<'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.