#[repr(C)]pub struct Header { /* private fields */ }
Expand description
A DNS header.
Implementations
sourceimpl Header
impl Header
pub fn id(&self) -> u16
pub fn set_id(&mut self, id: u16)
pub fn kind(&self) -> HeaderKind
pub fn set_kind(&mut self, kind: HeaderKind)
pub fn opcode(&self) -> OpCode
pub fn set_opcode(&mut self, opcode: OpCode)
pub fn truncated(&self) -> bool
pub fn recursion_desired(&self) -> bool
pub fn set_recursion_desired(&mut self, recursion_desired: bool)
pub fn recursion_available(&self) -> bool
pub fn set_recursion_available(&mut self, recursion_available: bool)
pub fn response_code(&self) -> ResponseCode
pub fn set_response_code(&mut self, response_code: ResponseCode)
pub fn question_count(&self) -> u16
sourcepub unsafe fn set_question_count(&mut self, question_count: u16)
pub unsafe fn set_question_count(&mut self, question_count: u16)
Safety
Setting the question count manually is unsafe. It is the caller’s responsibility to ensure that the corresponding message contains the right amount of questions.
pub fn answer_count(&self) -> u16
sourcepub unsafe fn set_answer_count(&mut self, answer_count: u16)
pub unsafe fn set_answer_count(&mut self, answer_count: u16)
Safety
Setting the answer count manually is unsafe. It is the caller’s responsibility to ensure that the corresponding message contains the right amount of answers.
pub fn name_server_count(&self) -> u16
sourcepub unsafe fn set_name_server_count(&mut self, name_server_count: u16)
pub unsafe fn set_name_server_count(&mut self, name_server_count: u16)
Safety
Setting the name server count manually is unsafe. It is the caller’s responsibility to ensure that the corresponding message contains the right amount of name servers.
pub fn additional_records_count(&self) -> u16
sourcepub unsafe fn set_additional_records_count(
&mut self,
additional_records_count: u16
)
pub unsafe fn set_additional_records_count(
&mut self,
additional_records_count: u16
)
Safety
Setting the additional records count manually is unsafe. It is the caller’s responsibility to ensure that the corresponding message contains the right amount of additional records.
pub fn builder() -> HeaderBuilder
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more