pub struct HeaderSection { /* private fields */ }
Expand description
The complete header section of a DNS message.
Consists of a Header
and a HeaderCounts
.
Implementations§
Source§impl HeaderSection
§Creation and Conversion
impl HeaderSection
§Creation and Conversion
Sourcepub fn for_message_slice(s: &[u8]) -> &HeaderSection
pub fn for_message_slice(s: &[u8]) -> &HeaderSection
Creates a reference from the bytes slice of a message.
§Panics
This function panics if the size of the bytes slice is smaller than the header section.
Sourcepub fn for_message_slice_mut(s: &mut [u8]) -> &mut HeaderSection
pub fn for_message_slice_mut(s: &mut [u8]) -> &mut HeaderSection
Creates a mutable reference from the bytes slice of a message.
§Panics
This function panics if the size of the bytes slice is smaller than the header section.
Source§impl HeaderSection
§Access to Header and Counts
impl HeaderSection
§Access to Header and Counts
Sourcepub fn header_mut(&mut self) -> &mut Header
pub fn header_mut(&mut self) -> &mut Header
Returns a mutable reference to the header.
Sourcepub fn counts(&self) -> &HeaderCounts
pub fn counts(&self) -> &HeaderCounts
Returns a reference to the header counts.
Sourcepub fn counts_mut(&mut self) -> &mut HeaderCounts
pub fn counts_mut(&mut self) -> &mut HeaderCounts
Returns a mutable reference to the header counts.
Trait Implementations§
Source§impl Clone for HeaderSection
impl Clone for HeaderSection
Source§fn clone(&self) -> HeaderSection
fn clone(&self) -> HeaderSection
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Compose for HeaderSection
impl Compose for HeaderSection
Source§impl Debug for HeaderSection
impl Debug for HeaderSection
Source§impl Default for HeaderSection
impl Default for HeaderSection
Source§fn default() -> HeaderSection
fn default() -> HeaderSection
Returns the “default value” for a type. Read more
Source§impl Parse for HeaderSection
impl Parse for HeaderSection
Source§impl PartialEq for HeaderSection
impl PartialEq for HeaderSection
impl Copy for HeaderSection
impl Eq for HeaderSection
impl StructuralPartialEq for HeaderSection
Auto Trait Implementations§
impl Freeze for HeaderSection
impl RefUnwindSafe for HeaderSection
impl Send for HeaderSection
impl Sync for HeaderSection
impl Unpin for HeaderSection
impl UnwindSafe for HeaderSection
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