Struct dns_parser::Header

source ·
pub struct Header {
Show 14 fields pub id: u16, pub query: bool, pub opcode: Opcode, pub authoritative: bool, pub truncated: bool, pub recursion_desired: bool, pub recursion_available: bool, pub authenticated_data: bool, pub checking_disabled: bool, pub response_code: ResponseCode, pub questions: u16, pub answers: u16, pub nameservers: u16, pub additional: u16,
}
Expand description

Represents parsed header of the packet

Fields§

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

Implementations§

Parse the header into a header structure

Write a header to a buffer slice

Panics

When buffer size is not exactly 12 bytes

Set “truncated flag” in the raw data

Returns a size of the header (always 12 bytes)

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. 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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.