pub struct HeaderSection { /* private fields */ }
Expand description
The complete header section of a DNS message.
Consists of a Header
directly followed by a HeaderCounts
.
You can create an owned value via the new
function or the
Default
trait and acquire a pointer referring the the header section of
an existing DNS message via the
for_message_slice
or
for_message_slice_mut
functions.
Implementations
sourceimpl HeaderSection
impl HeaderSection
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new header section.
The value will have all header and header counts fields set to zero or false.
sourcepub fn for_message_slice(s: &[u8]) -> &HeaderSection
pub fn for_message_slice(s: &[u8]) -> &HeaderSection
Creates a reference from the octets slice of a message.
Panics
This function panics if the octets slice is shorter than 12 octets.
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 octets slice of a message.
Panics
This function panics if the octets slice is shorter than 12 octets.
sourceimpl HeaderSection
impl HeaderSection
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
sourceimpl AsMut<Header> for HeaderSection
impl AsMut<Header> for HeaderSection
sourceimpl AsMut<HeaderCounts> for HeaderSection
impl AsMut<HeaderCounts> for HeaderSection
sourcefn as_mut(&mut self) -> &mut HeaderCounts
fn as_mut(&mut self) -> &mut HeaderCounts
Converts this type into a mutable reference of the (usually inferred) input type.
sourceimpl AsRef<Header> for HeaderSection
impl AsRef<Header> for HeaderSection
sourceimpl AsRef<HeaderCounts> for HeaderSection
impl AsRef<HeaderCounts> for HeaderSection
sourcefn as_ref(&self) -> &HeaderCounts
fn as_ref(&self) -> &HeaderCounts
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl Clone for HeaderSection
impl Clone for HeaderSection
sourcefn clone(&self) -> HeaderSection
fn clone(&self) -> HeaderSection
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Compose for HeaderSection
impl Compose for HeaderSection
sourcefn compose<T: OctetsBuilder>(&self, target: &mut T) -> Result<(), ShortBuf>
fn compose<T: OctetsBuilder>(&self, target: &mut T) -> Result<(), ShortBuf>
Appends the concrete representation of the value to the target. Read more
sourcefn compose_canonical<T: OctetsBuilder + AsMut<[u8]>>(
&self,
target: &mut T
) -> Result<(), ShortBuf>
fn compose_canonical<T: OctetsBuilder + AsMut<[u8]>>(
&self,
target: &mut T
) -> Result<(), ShortBuf>
Appends the canonical representation of the value to the target. Read more
sourceimpl Debug for HeaderSection
impl Debug for HeaderSection
sourceimpl Default for HeaderSection
impl Default for HeaderSection
sourcefn default() -> HeaderSection
fn default() -> HeaderSection
Returns the “default value” for a type. Read more
sourceimpl<Ref: AsRef<[u8]>> Parse<Ref> for HeaderSection
impl<Ref: AsRef<[u8]>> Parse<Ref> for HeaderSection
sourceimpl PartialEq<HeaderSection> for HeaderSection
impl PartialEq<HeaderSection> for HeaderSection
sourcefn eq(&self, other: &HeaderSection) -> bool
fn eq(&self, other: &HeaderSection) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
impl Copy for HeaderSection
impl Eq for HeaderSection
impl StructuralEq for HeaderSection
impl StructuralPartialEq for HeaderSection
Auto Trait Implementations
impl RefUnwindSafe for HeaderSection
impl Send for HeaderSection
impl Sync for HeaderSection
impl Unpin for HeaderSection
impl UnwindSafe for HeaderSection
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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
sourceimpl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
sourcefn octets_into(self) -> Result<Target, ShortBuf>
fn octets_into(self) -> Result<Target, ShortBuf>
Performs the conversion.