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>
impl<const PTR_STORAGE: usize, B: Buffer> DnsMessage<PTR_STORAGE, { 0 }, B>
pub fn next_section(self) -> DnsMessage<PTR_STORAGE, { 1 }, B>
Source§impl<const PTR_STORAGE: usize, B: Buffer> DnsMessage<PTR_STORAGE, { 1 }, B>
impl<const PTR_STORAGE: usize, B: Buffer> DnsMessage<PTR_STORAGE, { 1 }, B>
pub fn next_section(self) -> DnsMessage<PTR_STORAGE, { 2 }, B>
Source§impl<const PTR_STORAGE: usize, B: Buffer> DnsMessage<PTR_STORAGE, { 2 }, B>
impl<const PTR_STORAGE: usize, B: Buffer> DnsMessage<PTR_STORAGE, { 2 }, B>
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>
impl<const PTR_STORAGE: usize, const SECTION: usize, B: Buffer> DnsMessage<PTR_STORAGE, SECTION, B>
Sourcepub fn new(buffer: B) -> Result<Self, DnsMessageError>
pub fn new(buffer: B) -> Result<Self, DnsMessageError>
Creates a new DNS message with the given buffer.
Sourcepub fn reset(self) -> DnsMessage<PTR_STORAGE, 0, B>
pub fn reset(self) -> DnsMessage<PTR_STORAGE, 0, B>
Resets the message to the start of the buffer.
Sourcepub fn abort(self) -> Result<B, DnsMessageError>
pub fn abort(self) -> Result<B, DnsMessageError>
Aborts the message and returns the buffer.
Sourcepub fn header(&self) -> Result<&DnsHeader, DnsMessageError>
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>
impl<const PTR_STORAGE: usize, const SECTION: usize, B: MutBuffer + Buffer> DnsMessage<PTR_STORAGE, SECTION, B>
Sourcepub fn new_mut(buffer: B) -> Result<Self, DnsMessageError>
pub fn new_mut(buffer: B) -> Result<Self, DnsMessageError>
Creates a new DNS message with the given buffer.
Sourcepub fn header_mut(&mut self) -> Result<&mut DnsHeader, DnsMessageError>
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>
impl<const PTR_STORAGE: usize, B: Buffer> DnsMessage<PTR_STORAGE, 0, B>
Sourcepub fn questions(self) -> DnsQuestions<PTR_STORAGE, B>
pub fn questions(self) -> DnsQuestions<PTR_STORAGE, B>
Read or write questions in the message.
Sourcepub fn complete(self) -> Result<(B, usize), DnsMessageError>
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>
impl<const PTR_STORAGE: usize, B: Buffer> DnsMessage<PTR_STORAGE, 1, B>
Sourcepub fn answers(self) -> DnsAnswers<PTR_STORAGE, B>
pub fn answers(self) -> DnsAnswers<PTR_STORAGE, B>
Read or write answers in the message.
Sourcepub fn complete(self) -> Result<(B, usize), DnsMessageError>
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>
impl<const PTR_STORAGE: usize, B: Buffer> DnsMessage<PTR_STORAGE, 2, B>
Sourcepub fn name_servers(self) -> DnsNameServers<PTR_STORAGE, B>
pub fn name_servers(self) -> DnsNameServers<PTR_STORAGE, B>
Read or write name servers in the message.
Sourcepub fn complete(self) -> Result<(B, usize), DnsMessageError>
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>
impl<const PTR_STORAGE: usize, B: Buffer> DnsMessage<PTR_STORAGE, 3, B>
Sourcepub fn additionals(self) -> DnsAdditionals<PTR_STORAGE, B>
pub fn additionals(self) -> DnsAdditionals<PTR_STORAGE, B>
Read or write additionals in the message.
Sourcepub fn complete(self) -> Result<(B, usize), DnsMessageError>
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> 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