pub struct DnsBuilder {Show 16 fields
pub id: u16,
pub qr: bool,
pub opcode: u8,
pub aa: bool,
pub tc: bool,
pub rd: bool,
pub ra: bool,
pub z: bool,
pub ad: bool,
pub cd: bool,
pub rcode: u8,
pub questions: Vec<DnsQuestion>,
pub answers: Vec<DnsResourceRecord>,
pub authorities: Vec<DnsResourceRecord>,
pub additionals: Vec<DnsResourceRecord>,
pub compress: bool,
}Expand description
Builder for constructing DNS packets.
Fields§
§id: u16Transaction ID.
qr: boolQuery/Response flag.
opcode: u8Operation code.
aa: boolAuthoritative Answer flag.
tc: boolTruncation flag.
rd: boolRecursion Desired flag.
ra: boolRecursion Available flag.
z: boolReserved (Z) flag.
ad: boolAuthenticated Data flag (DNSSEC).
cd: boolChecking Disabled flag (DNSSEC).
rcode: u8Response code.
questions: Vec<DnsQuestion>Question section.
answers: Vec<DnsResourceRecord>Answer section.
Authority section.
additionals: Vec<DnsResourceRecord>Additional section.
compress: boolWhether to use DNS name compression when building.
Implementations§
Source§impl DnsBuilder
impl DnsBuilder
pub fn id(self, id: u16) -> Self
pub fn qr(self, qr: bool) -> Self
pub fn opcode(self, opcode: u8) -> Self
pub fn aa(self, aa: bool) -> Self
pub fn tc(self, tc: bool) -> Self
pub fn rd(self, rd: bool) -> Self
pub fn ra(self, ra: bool) -> Self
pub fn z(self, z: bool) -> Self
pub fn ad(self, ad: bool) -> Self
pub fn cd(self, cd: bool) -> Self
pub fn rcode(self, rcode: u8) -> Self
pub fn compress(self, compress: bool) -> Self
Sourcepub fn question(self, q: DnsQuestion) -> Self
pub fn question(self, q: DnsQuestion) -> Self
Add a question to the question section.
Sourcepub fn answer(self, rr: DnsResourceRecord) -> Self
pub fn answer(self, rr: DnsResourceRecord) -> Self
Add a resource record to the answer section.
Add a resource record to the authority section.
Sourcepub fn additional(self, rr: DnsResourceRecord) -> Self
pub fn additional(self, rr: DnsResourceRecord) -> Self
Add a resource record to the additional section.
Sourcepub fn header_size(&self) -> usize
pub fn header_size(&self) -> usize
Get the minimum header size.
Trait Implementations§
Source§impl Clone for DnsBuilder
impl Clone for DnsBuilder
Source§fn clone(&self) -> DnsBuilder
fn clone(&self) -> DnsBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DnsBuilder
impl Debug for DnsBuilder
Source§impl Default for DnsBuilder
impl Default for DnsBuilder
Source§impl From<DnsBuilder> for LayerStack
impl From<DnsBuilder> for LayerStack
Source§fn from(builder: DnsBuilder) -> Self
fn from(builder: DnsBuilder) -> Self
Converts to this type from the input type.
Source§impl IntoLayerStackEntry for DnsBuilder
impl IntoLayerStackEntry for DnsBuilder
fn into_layer_stack_entry(self) -> LayerStackEntry
Auto Trait Implementations§
impl Freeze for DnsBuilder
impl RefUnwindSafe for DnsBuilder
impl Send for DnsBuilder
impl Sync for DnsBuilder
impl Unpin for DnsBuilder
impl UnsafeUnpin for DnsBuilder
impl UnwindSafe for DnsBuilder
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