Struct dns_parser::Packet[][src]

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>>,
}

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

impl<'a> Packet<'a>[src]

pub fn parse(data: &[u8]) -> Result<Packet<'_>, Error>[src]

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

Trait Implementations

impl<'a> Debug for Packet<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Packet<'a>

impl<'a> Send for Packet<'a>

impl<'a> Sync for Packet<'a>

impl<'a> Unpin for Packet<'a>

impl<'a> UnwindSafe for Packet<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.