[][src]Struct domain::base::header::HeaderSection

pub struct HeaderSection { /* fields omitted */ }

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 Default trait or 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

impl HeaderSection[src]

pub fn new() -> Self[src]

Creates a new header section.

The value will have all header and header counts fields set to zero or false.

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

Creates a reference from the octets slice of a message.

Panics

This function panics if the the octets slice is shorter than 24 octets.

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

Creates a mutable reference from the ocetets slice of a message.

Panics

This function panics if the the octets slice is shorter than 24 octets.

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

Returns a reference to the underlying octets 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 AsMut<Header> for HeaderSection[src]

impl AsMut<HeaderCounts> for HeaderSection[src]

impl AsRef<Header> for HeaderSection[src]

impl AsRef<HeaderCounts> for HeaderSection[src]

impl Clone for HeaderSection[src]

impl Compose for HeaderSection[src]

impl Copy for HeaderSection[src]

impl Debug for HeaderSection[src]

impl Default for HeaderSection[src]

impl Eq for HeaderSection[src]

impl<Ref: AsRef<[u8]>> Parse<Ref> for HeaderSection[src]

impl PartialEq<HeaderSection> for HeaderSection[src]

impl StructuralEq for HeaderSection[src]

impl StructuralPartialEq for HeaderSection[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,