pub struct DnsPacket<'a> { /* private fields */ }Expand description
Zero-copy DNS message parser.
Implementations§
Source§impl<'a> DnsPacket<'a>
impl<'a> DnsPacket<'a>
pub fn new(buf: &'a [u8]) -> Option<Self>
pub fn transaction_id(&self) -> u16
pub fn flags(&self) -> u16
pub fn qr(&self) -> bool
pub fn opcode(&self) -> DnsOpcode
pub fn aa(&self) -> bool
pub fn tc(&self) -> bool
pub fn rd(&self) -> bool
pub fn ra(&self) -> bool
pub fn rcode(&self) -> DnsRcode
pub fn questions_count(&self) -> u16
pub fn answers_count(&self) -> u16
pub fn additionals_count(&self) -> u16
Sourcepub fn questions(&self) -> DnsQuestionIter<'a> ⓘ
pub fn questions(&self) -> DnsQuestionIter<'a> ⓘ
Iterate over the Question section.
Sourcepub fn answers(&self) -> DnsRecordIter<'a> ⓘ
pub fn answers(&self) -> DnsRecordIter<'a> ⓘ
Iterate over the Answer section.
Iterate over the Authority section.
Sourcepub fn additionals(&self) -> DnsRecordIter<'a> ⓘ
pub fn additionals(&self) -> DnsRecordIter<'a> ⓘ
Iterate over the Additional section.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for DnsPacket<'a>
impl<'a> RefUnwindSafe for DnsPacket<'a>
impl<'a> Send for DnsPacket<'a>
impl<'a> Sync for DnsPacket<'a>
impl<'a> Unpin for DnsPacket<'a>
impl<'a> UnsafeUnpin for DnsPacket<'a>
impl<'a> UnwindSafe for DnsPacket<'a>
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