[][src]Struct rusty_dns::dns_packet::DnsPacket

pub struct DnsPacket {
    pub header: DnsHeader,
    pub question: Vec<DnsQuestion>,
    pub answer: Vec<DnsResourceRecord>,
    pub authority: Vec<DnsResourceRecord>,
    pub additional: Vec<DnsResourceRecord>,
}

DNS Packet.

Fields

header: DnsHeader

DNS Header for the DNS packet.

question: Vec<DnsQuestion>

DNS Question section for the DNS packet.

answer: Vec<DnsResourceRecord>

DNS Answer section for the DNS packet.

authority: Vec<DnsResourceRecord>

DNS Authority section for the DNS packet.

additional: Vec<DnsResourceRecord>

DNS Additonal section for the DNS packet.

Implementations

impl DnsPacket[src]

pub fn new(
    domain_name: &String,
    resource_record_type: u16
) -> Result<DnsPacket, String>
[src]

pub fn parse_dns_packet(dns_packet_buf: &Vec<u8>) -> Result<DnsPacket, String>[src]

Parse a DNS packet from a raw DNS packet.

pub fn serialize(&self) -> Result<Vec<u8>, String>[src]

Serialize the DNS packet into a DNS protocol conformant, network ready buffer.

Trait Implementations

impl Debug for DnsPacket[src]

Auto Trait Implementations

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,