pub struct DnsPacket {
pub header: DnsHeader,
pub queries: Vec<DnsQueryPacket>,
pub responses: Vec<DnsResponsePacket>,
pub authorities: Vec<DnsResponsePacket>,
pub additionals: Vec<DnsResponsePacket>,
pub payload: Bytes,
}Expand description
Represents a DNS packet. Including its header and all the associated records.
Fields§
§header: DnsHeader§queries: Vec<DnsQueryPacket>§responses: Vec<DnsResponsePacket>§additionals: Vec<DnsResponsePacket>§payload: BytesTrait Implementations§
Source§impl Packet for DnsPacket
impl Packet for DnsPacket
type Header = ()
Source§fn from_bytes(bytes: Bytes) -> Option<Self>
fn from_bytes(bytes: Bytes) -> Option<Self>
Parse from raw bytes. (with ownership)
Source§fn header_len(&self) -> usize
fn header_len(&self) -> usize
Get the length of the header.
Source§fn payload_len(&self) -> usize
fn payload_len(&self) -> usize
Get the length of the payload.
fn into_parts(self) -> (Self::Header, Bytes)
Source§fn to_bytes_mut(&self) -> BytesMut
fn to_bytes_mut(&self) -> BytesMut
Convert the packet to a mutable byte buffer.
Source§fn header_mut(&self) -> BytesMut
fn header_mut(&self) -> BytesMut
Get a mutable byte buffer for the header.
Source§fn payload_mut(&self) -> BytesMut
fn payload_mut(&self) -> BytesMut
Get a mutable byte buffer for the payload.
impl Eq for DnsPacket
impl StructuralPartialEq for DnsPacket
Auto Trait Implementations§
impl !Freeze for DnsPacket
impl RefUnwindSafe for DnsPacket
impl Send for DnsPacket
impl Sync for DnsPacket
impl Unpin for DnsPacket
impl UnwindSafe for DnsPacket
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