pub struct Packet<'a> {
    pub header: Header,
    pub questions: Vec<Question<'a>>,
    pub answers: Vec<ResourceRecord<'a>>,
    pub nameservers: Vec<ResourceRecord<'a>>,
    pub additional: Vec<ResourceRecord<'a>>,
    pub opt: Option<Record<'a>>,
}
Expand description

Parsed DNS packet

Fields

header: Headerquestions: Vec<Question<'a>>answers: Vec<ResourceRecord<'a>>nameservers: Vec<ResourceRecord<'a>>additional: Vec<ResourceRecord<'a>>opt: Option<Record<'a>>

Optional Pseudo-RR When present it is sent as an RR in the additional section. In this RR the class and ttl fields store max udp packet size and flags respectively. To keep ResourceRecord clean we store the OPT record here.

Implementations

Parse a full DNS Packet and return a structure that has all the data borrowed from the passed buffer.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.