Struct domain::bits::question::Question [−][src]
pub struct Question<N: DName> { /* fields omitted */ }
A question in a DNS message.
In DNS, a query is determined by three elements: a domain name, a record type, and a class, collectively called a question. This type represents such a question.
Questions are generic over the domain name type. For a question with a
ParsedDName
, parsing is implemented. Composing, meanwhile, is
available with all domain name types.
In order to allow questions on the fly, in particular when creating
messages via MessageBuilder
, the From
trait is implemented for
tuples of all three elements of a question as well as for only name
and record type assuming Class::In
which is likely what you want,
anyway.
Methods
impl<N: DName> Question<N>
[src]
impl<N: DName> Question<N>
pub fn new(qname: N, qtype: Rtype, qclass: Class) -> Self
[src]
pub fn new(qname: N, qtype: Rtype, qclass: Class) -> Self
Creates a new question from its constituent elements.
impl<N: DName> Question<N>
[src]
impl<N: DName> Question<N>
pub fn qname(&self) -> &N
[src]
pub fn qname(&self) -> &N
Returns the requested domain name.
pub fn qtype(&self) -> Rtype
[src]
pub fn qtype(&self) -> Rtype
Returns the requested record type.
pub fn qclass(&self) -> Class
[src]
pub fn qclass(&self) -> Class
Returns the requested class.
impl<'a> Question<ParsedDName<'a>>
[src]
impl<'a> Question<ParsedDName<'a>>
pub fn parse(parser: &mut Parser<'a>) -> ParseResult<Self>
[src]
pub fn parse(parser: &mut Parser<'a>) -> ParseResult<Self>
Parses a question from the beginning of a parser.
impl<N: DName> Question<N>
[src]
impl<N: DName> Question<N>
pub fn compose<C: AsMut<Composer>>(&self, composer: C) -> ComposeResult<()>
[src]
pub fn compose<C: AsMut<Composer>>(&self, composer: C) -> ComposeResult<()>
Appends the question to a composition.
Trait Implementations
impl<N: Clone + DName> Clone for Question<N>
[src]
impl<N: Clone + DName> Clone for Question<N>
fn clone(&self) -> Question<N>
[src]
fn clone(&self) -> Question<N>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<N: Debug + DName> Debug for Question<N>
[src]
impl<N: Debug + DName> Debug for Question<N>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<N: Eq + DName> Eq for Question<N>
[src]
impl<N: Eq + DName> Eq for Question<N>
impl<N: Hash + DName> Hash for Question<N>
[src]
impl<N: Hash + DName> Hash for Question<N>
fn hash<__HN: Hasher>(&self, state: &mut __HN)
[src]
fn hash<__HN: Hasher>(&self, state: &mut __HN)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<N: Ord + DName> Ord for Question<N>
[src]
impl<N: Ord + DName> Ord for Question<N>
fn cmp(&self, other: &Question<N>) -> Ordering
[src]
fn cmp(&self, other: &Question<N>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl<N: PartialEq + DName> PartialEq for Question<N>
[src]
impl<N: PartialEq + DName> PartialEq for Question<N>
fn eq(&self, other: &Question<N>) -> bool
[src]
fn eq(&self, other: &Question<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Question<N>) -> bool
[src]
fn ne(&self, other: &Question<N>) -> bool
This method tests for !=
.
impl<N: PartialOrd + DName> PartialOrd for Question<N>
[src]
impl<N: PartialOrd + DName> PartialOrd for Question<N>
fn partial_cmp(&self, other: &Question<N>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Question<N>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Question<N>) -> bool
[src]
fn lt(&self, other: &Question<N>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Question<N>) -> bool
[src]
fn le(&self, other: &Question<N>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Question<N>) -> bool
[src]
fn gt(&self, other: &Question<N>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Question<N>) -> bool
[src]
fn ge(&self, other: &Question<N>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<N: DName> From<(N, Rtype, Class)> for Question<N>
[src]
impl<N: DName> From<(N, Rtype, Class)> for Question<N>
impl<N: DName> From<(N, Rtype)> for Question<N>
[src]
impl<N: DName> From<(N, Rtype)> for Question<N>
impl<N: DName + Display> Display for Question<N>
[src]
impl<N: DName + Display> Display for Question<N>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<N: DName + Octal> Octal for Question<N>
[src]
impl<N: DName + Octal> Octal for Question<N>
impl<N: DName + LowerHex> LowerHex for Question<N>
[src]
impl<N: DName + LowerHex> LowerHex for Question<N>
impl<N: DName + UpperHex> UpperHex for Question<N>
[src]
impl<N: DName + UpperHex> UpperHex for Question<N>
impl<N: DName + Binary> Binary for Question<N>
[src]
impl<N: DName + Binary> Binary for Question<N>