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: u16query: boolopcode: Opcodeauthoritative: booltruncated: boolrecursion_desired: boolrecursion_available: boolauthenticated_data: boolchecking_disabled: boolresponse_code: ResponseCodequestions: u16answers: u16nameservers: u16additional: 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 !=.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.