pub struct DnsHeader { /* private fields */ }Expand description
A DNS header.
Implementations§
Source§impl DnsHeader
impl DnsHeader
Sourcepub fn kind(&self) -> DnsHeaderKind
pub fn kind(&self) -> DnsHeaderKind
The kind of the DNS header.
Sourcepub fn opcode(&self) -> DnsHeaderOpcode
pub fn opcode(&self) -> DnsHeaderOpcode
The opcode of the DNS header.
Whether the DNS header is an authoritative answer.
Sourcepub fn recursion_desired(&self) -> bool
pub fn recursion_desired(&self) -> bool
Whether the DNS header recursion is desired.
Sourcepub fn recursion_available(&self) -> bool
pub fn recursion_available(&self) -> bool
Whether the DNS header recursion is available.
Sourcepub fn response_code(&self) -> DnsHeaderResponseCode
pub fn response_code(&self) -> DnsHeaderResponseCode
The response code of the DNS header.
Sourcepub fn question_count(&self) -> u16
pub fn question_count(&self) -> u16
The number of questions in the DNS message.
Sourcepub fn answer_count(&self) -> u16
pub fn answer_count(&self) -> u16
The number of answers in the DNS message.
Sourcepub fn name_server_count(&self) -> u16
pub fn name_server_count(&self) -> u16
The number of name servers in the DNS message.
Sourcepub fn additional_records_count(&self) -> u16
pub fn additional_records_count(&self) -> u16
The number of additional records in the DNS message.
Sourcepub fn set_kind(&mut self, kind: DnsHeaderKind)
pub fn set_kind(&mut self, kind: DnsHeaderKind)
Set the kind of the DNS header.
Sourcepub fn set_opcode(&mut self, opcode: DnsHeaderOpcode)
pub fn set_opcode(&mut self, opcode: DnsHeaderOpcode)
Set the opcode of the DNS header.
Set whether the DNS header is an authoritative answer.
Sourcepub fn set_truncated(&mut self, truncated: bool)
pub fn set_truncated(&mut self, truncated: bool)
Set whether the DNS header is truncated.
Sourcepub fn set_recursion_desired(&mut self, recursion_desired: bool)
pub fn set_recursion_desired(&mut self, recursion_desired: bool)
Set whether recursion is desired.
Sourcepub fn set_recursion_available(&mut self, recursion_available: bool)
pub fn set_recursion_available(&mut self, recursion_available: bool)
Set whether recursion is available.
Sourcepub fn set_response_code(&mut self, response_code: DnsHeaderResponseCode)
pub fn set_response_code(&mut self, response_code: DnsHeaderResponseCode)
Set the response code of the DNS header.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DnsHeader
impl RefUnwindSafe for DnsHeader
impl Send for DnsHeader
impl Sync for DnsHeader
impl Unpin for DnsHeader
impl UnwindSafe for DnsHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more