[][src]Struct rusty_dns::dns_packet::dns_resource_record::DnsResourceRecord

pub struct DnsResourceRecord {
    pub name: String,
    pub rrtype: u16,
    pub class: u16,
    pub ttl: u32,
    pub rdlength: u16,
    pub rdata: DnsResourceRecordData,
}

DNS Resource Record.

Fields

name: String

Name of the resource record.

rrtype: u16

Type of the resource record.

class: u16

Class of the resource record.

ttl: u32

TTL (Time to Live) of the resource record.

rdlength: u16

Length in bytes of the resource record data.

rdata: DnsResourceRecordData

The actual data for the resource record.

Implementations

impl DnsResourceRecord[src]

pub fn new(
    name: String,
    rrtype: u16,
    class: u16,
    ttl: u32,
    rdlength: u16,
    rdata: DnsResourceRecordData
) -> Result<DnsResourceRecord, String>
[src]

Create a DNS resource record.

pub fn parse_resource_records(
    buf: &Vec<u8>,
    start: usize,
    rrcount: u16
) -> Result<(Vec<DnsResourceRecord>, usize), String>
[src]

Parse a DNS resource record section (i.e. Answer, Additional) from a raw DNS packet.

pub fn serialize(
    &self,
    start: usize,
    buf: &mut Vec<u8>,
    domain_name_offsets: &mut HashMap<String, u16>
) -> Result<usize, String>
[src]

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

Trait Implementations

impl Debug for DnsResourceRecord[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>,