pub struct DnsPacketBuilder { /* private fields */ }Expand description
Builder for DNS messages.
Implementations§
Source§impl DnsPacketBuilder
impl DnsPacketBuilder
pub fn new() -> Self
pub fn transaction_id(self, id: u16) -> Self
pub fn truncated(self, tc: bool) -> Self
pub fn recursion_desired(self, rd: bool) -> Self
pub fn recursion_available(self, ra: bool) -> Self
pub fn rcode(self, rcode: DnsRcode) -> Self
Sourcepub fn add_question(self, name: &str, qtype: DnsType, qclass: DnsClass) -> Self
pub fn add_question(self, name: &str, qtype: DnsType, qclass: DnsClass) -> Self
Add a question entry.
Sourcepub fn add_raw_answer(
self,
name: &str,
qtype: DnsType,
ttl: u32,
rdata: &[u8],
) -> Self
pub fn add_raw_answer( self, name: &str, qtype: DnsType, ttl: u32, rdata: &[u8], ) -> Self
Add an answer record (pre-encoded RDATA).
Add an authority record.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DnsPacketBuilder
impl RefUnwindSafe for DnsPacketBuilder
impl Send for DnsPacketBuilder
impl Sync for DnsPacketBuilder
impl Unpin for DnsPacketBuilder
impl UnsafeUnpin for DnsPacketBuilder
impl UnwindSafe for DnsPacketBuilder
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