pub struct Question<N> { /* private fields */ }
Expand description
A question in a DNS message.
In DNS, a question describes what is requested in a query. It consists of three elements: a domain name, a record type, and a class. This type represents such a question.
Questions are generic over the domain name type. When read from an
actual message, a ParsedName
has to be used because the name part
may be compressed.
Implementations§
source§impl<N> Question<N>
impl<N> Question<N>
§Creation and Conversion
sourcepub fn new(qname: N, qtype: Rtype, qclass: Class) -> Self
pub fn new(qname: N, qtype: Rtype, qclass: Class) -> Self
Creates a new question from its three componets.
sourcepub fn new_in(qname: N, qtype: Rtype) -> Self
pub fn new_in(qname: N, qtype: Rtype) -> Self
Creates a new question from a name and record type, assuming class IN.
sourcepub fn into_qname(self) -> N
pub fn into_qname(self) -> N
Converts the question into the qname.
source§impl<Octs> Question<ParsedName<Octs>>
impl<Octs> Question<ParsedName<Octs>>
§Parsing and Composing
Trait Implementations§
source§impl<N, NN> CanonicalOrd<Question<NN>> for Question<N>
impl<N, NN> CanonicalOrd<Question<NN>> for Question<N>
source§fn canonical_cmp(&self, other: &Question<NN>) -> Ordering
fn canonical_cmp(&self, other: &Question<NN>) -> Ordering
self
and other
.source§fn canonical_lt(&self, other: &Rhs) -> bool
fn canonical_lt(&self, other: &Rhs) -> bool
self
is canonically less than other
.source§fn canonical_le(&self, other: &Rhs) -> bool
fn canonical_le(&self, other: &Rhs) -> bool
self
is canonically less than or equal to other
.source§fn canonical_gt(&self, other: &Rhs) -> bool
fn canonical_gt(&self, other: &Rhs) -> bool
self
is canonically greater than other
.source§fn canonical_ge(&self, other: &Rhs) -> bool
fn canonical_ge(&self, other: &Rhs) -> bool
self
is canonically greater than or equal to other
.source§impl<Name: ToName> ComposeQuestion for Question<Name>
impl<Name: ToName> ComposeQuestion for Question<Name>
fn compose_question<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
source§impl<N: FromStr<Err = FromStrError>> FromStr for Question<N>
impl<N: FromStr<Err = FromStrError>> FromStr for Question<N>
source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parses a question from a string.
The string should contain a question as the query name, class, and
query type separated by white space. The query name should be first
and in the same form as Name::from_str
requires. The class and
query type follow the name in either order. If the class is left out,
it is assumed to be IN.
source§type Err = FromStrError
type Err = FromStrError
source§impl<Name, SrcName> OctetsFrom<Question<SrcName>> for Question<Name>where
Name: OctetsFrom<SrcName>,
impl<Name, SrcName> OctetsFrom<Question<SrcName>> for Question<Name>where
Name: OctetsFrom<SrcName>,
source§impl<N: ToName> Ord for Question<N>
impl<N: ToName> Ord for Question<N>
source§impl<N, NN> PartialOrd<Question<NN>> for Question<N>
impl<N, NN> PartialOrd<Question<NN>> for Question<N>
impl<N: Copy> Copy for Question<N>
impl<N: ToName> Eq for Question<N>
Auto Trait Implementations§
impl<N> Freeze for Question<N>where
N: Freeze,
impl<N> RefUnwindSafe for Question<N>where
N: RefUnwindSafe,
impl<N> Send for Question<N>where
N: Send,
impl<N> Sync for Question<N>where
N: Sync,
impl<N> Unpin for Question<N>where
N: Unpin,
impl<N> UnwindSafe for Question<N>where
N: 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)