Struct dns_parser::Header [] [src]

pub struct Header {
    pub id: u16,
    pub query: bool,
    pub opcode: Opcode,
    pub authoritative: bool,
    pub truncated: bool,
    pub recursion_desired: bool,
    pub recursion_available: bool,
    pub response_code: ResponseCode,
    pub questions: u16,
    pub answers: u16,
    pub nameservers: u16,
    pub additional: u16,
}

Represents parsed header of the packet

Fields

id: u16 query: bool opcode: Opcode authoritative: bool truncated: bool recursion_desired: bool recursion_available: bool response_code: ResponseCode questions: u16 answers: u16 nameservers: u16 additional: u16

Methods

impl Header
[src]

fn parse(data: &[u8]) -> Result<HeaderError>

fn write(&self, data: &mut [u8])

Write a header to a buffer slice

Panics

When buffer size is not exactly 12 bytes

fn set_truncated(data: &mut [u8])

fn size() -> usize

Trait Implementations

impl Copy for Header
[src]

impl Clone for Header
[src]

fn clone(&self) -> Header

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Eq for Header
[src]

impl PartialEq for Header
[src]

fn eq(&self, __arg_0: &Header) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Header) -> bool

This method tests for !=.

impl Debug for Header
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.