Struct DnsMessage

Source
pub struct DnsMessage<const PTR_STORAGE: usize, const DNS_SECTION: usize, B> { /* private fields */ }
Expand description

A DNS message.

Implementations§

Source§

impl<const PTR_STORAGE: usize, B: Buffer> DnsMessage<PTR_STORAGE, { 0 }, B>

Source

pub fn next_section(self) -> DnsMessage<PTR_STORAGE, { 1 }, B>

Source§

impl<const PTR_STORAGE: usize, B: Buffer> DnsMessage<PTR_STORAGE, { 1 }, B>

Source

pub fn next_section(self) -> DnsMessage<PTR_STORAGE, { 2 }, B>

Source§

impl<const PTR_STORAGE: usize, B: Buffer> DnsMessage<PTR_STORAGE, { 2 }, B>

Source

pub fn next_section(self) -> DnsMessage<PTR_STORAGE, { 3 }, B>

Source§

impl<const PTR_STORAGE: usize, const SECTION: usize, B: Buffer> DnsMessage<PTR_STORAGE, SECTION, B>

Source

pub fn new(buffer: B) -> Result<Self, DnsMessageError>

Creates a new DNS message with the given buffer.

Source

pub fn reset(self) -> DnsMessage<PTR_STORAGE, 0, B>

Resets the message to the start of the buffer.

Source

pub fn abort(self) -> Result<B, DnsMessageError>

Aborts the message and returns the buffer.

Source

pub fn header(&self) -> Result<&DnsHeader, DnsMessageError>

Returns the header of the message (read-only reference).

Source§

impl<const PTR_STORAGE: usize, const SECTION: usize, B: MutBuffer + Buffer> DnsMessage<PTR_STORAGE, SECTION, B>

Source

pub fn new_mut(buffer: B) -> Result<Self, DnsMessageError>

Creates a new DNS message with the given buffer.

Source

pub fn header_mut(&mut self) -> Result<&mut DnsHeader, DnsMessageError>

Returns the header of the message as a mutable reference.

Source§

impl<const PTR_STORAGE: usize, B: Buffer> DnsMessage<PTR_STORAGE, 0, B>

Source

pub fn questions(self) -> DnsQuestions<PTR_STORAGE, B>

Read or write questions in the message.

Source

pub fn complete(self) -> Result<(B, usize), DnsMessageError>

Completes and verifies the message and returns the buffer.

Source§

impl<const PTR_STORAGE: usize, B: Buffer> DnsMessage<PTR_STORAGE, 1, B>

Source

pub fn answers(self) -> DnsAnswers<PTR_STORAGE, B>

Read or write answers in the message.

Source

pub fn complete(self) -> Result<(B, usize), DnsMessageError>

Completes and verifies the message and returns the buffer.

Source§

impl<const PTR_STORAGE: usize, B: Buffer> DnsMessage<PTR_STORAGE, 2, B>

Source

pub fn name_servers(self) -> DnsNameServers<PTR_STORAGE, B>

Read or write name servers in the message.

Source

pub fn complete(self) -> Result<(B, usize), DnsMessageError>

Completes and verifies the message and returns the buffer.

Source§

impl<const PTR_STORAGE: usize, B: Buffer> DnsMessage<PTR_STORAGE, 3, B>

Source

pub fn additionals(self) -> DnsAdditionals<PTR_STORAGE, B>

Read or write additionals in the message.

Source

pub fn complete(self) -> Result<(B, usize), DnsMessageError>

Completes and verifies the message and returns the buffer.

Auto Trait Implementations§

§

impl<const PTR_STORAGE: usize, const DNS_SECTION: usize, B> Freeze for DnsMessage<PTR_STORAGE, DNS_SECTION, B>
where B: Freeze,

§

impl<const PTR_STORAGE: usize, const DNS_SECTION: usize, B> RefUnwindSafe for DnsMessage<PTR_STORAGE, DNS_SECTION, B>
where B: RefUnwindSafe,

§

impl<const PTR_STORAGE: usize, const DNS_SECTION: usize, B> Send for DnsMessage<PTR_STORAGE, DNS_SECTION, B>
where B: Send,

§

impl<const PTR_STORAGE: usize, const DNS_SECTION: usize, B> Sync for DnsMessage<PTR_STORAGE, DNS_SECTION, B>
where B: Sync,

§

impl<const PTR_STORAGE: usize, const DNS_SECTION: usize, B> Unpin for DnsMessage<PTR_STORAGE, DNS_SECTION, B>
where B: Unpin,

§

impl<const PTR_STORAGE: usize, const DNS_SECTION: usize, B> UnwindSafe for DnsMessage<PTR_STORAGE, DNS_SECTION, B>
where B: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.