[][src]Struct domain_core::bits::header::HeaderSection

pub struct HeaderSection { /* fields omitted */ }

The complete header section of a DNS message.

Consists of a Header and a HeaderCounts.

Methods

impl HeaderSection[src]

pub fn new() -> Self[src]

Creates a new empty header section.

pub fn for_message_slice(s: &[u8]) -> &HeaderSection[src]

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.

pub fn for_message_slice_mut(s: &mut [u8]) -> &mut HeaderSection[src]

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.

pub fn as_slice(&self) -> &[u8][src]

Returns a reference to the underlying bytes slice.

impl HeaderSection[src]

pub fn header(&self) -> &Header[src]

Returns a reference to the header.

pub fn header_mut(&mut self) -> &mut Header[src]

Returns a mutable reference to the header.

pub fn counts(&self) -> &HeaderCounts[src]

Returns a reference to the header counts.

pub fn counts_mut(&mut self) -> &mut HeaderCounts[src]

Returns a mutable reference to the header counts.

Trait Implementations

impl Compose for HeaderSection[src]

impl Parse for HeaderSection[src]

type Err = ShortBuf

The type of an error returned when parsing fails.

impl Eq for HeaderSection[src]

impl Clone for HeaderSection[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for HeaderSection[src]

impl PartialEq<HeaderSection> for HeaderSection[src]

impl Default for HeaderSection[src]

impl Debug for HeaderSection[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

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

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

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

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]