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>
§Creation and Conversion
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>>
§Parsing and Composing
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.