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 ParsedDname
has to be used because the name part
may be compressed.
Implementations§
source§impl<N> Question<N>
impl<N> Question<N>
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<ParsedDname<Octs>>
impl<Octs> Question<ParsedDname<Octs>>
Trait Implementations§
source§impl<N, NN> CanonicalOrd<Question<NN>> for Question<N>where
N: ToDname,
NN: ToDname,
impl<N, NN> CanonicalOrd<Question<NN>> for Question<N>where N: ToDname, NN: ToDname,
source§fn canonical_cmp(&self, other: &Question<NN>) -> Ordering
fn canonical_cmp(&self, other: &Question<NN>) -> Ordering
Returns the canonical ordering between
self
and other
.source§fn canonical_lt(&self, other: &Rhs) -> bool
fn canonical_lt(&self, other: &Rhs) -> bool
Returns whether
self
is canonically less than other
.source§fn canonical_le(&self, other: &Rhs) -> bool
fn canonical_le(&self, other: &Rhs) -> bool
Returns whether
self
is canonically less than or equal to other
.source§fn canonical_gt(&self, other: &Rhs) -> bool
fn canonical_gt(&self, other: &Rhs) -> bool
Returns whether
self
is canonically greater than other
.source§fn canonical_ge(&self, other: &Rhs) -> bool
fn canonical_ge(&self, other: &Rhs) -> bool
Returns whether
self
is canonically greater than or equal to other
.source§impl<Name: ToDname> ComposeQuestion for Question<Name>
impl<Name: ToDname> ComposeQuestion for Question<Name>
fn compose_question<Target: Composer + ?Sized>( &self, target: &mut Target ) -> Result<(), Target::AppendError>
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>,
type Error = <Name as OctetsFrom<SrcName>>::Error
source§impl<N: ToDname> Ord for Question<N>
impl<N: ToDname> Ord for Question<N>
source§impl<N, NN> PartialEq<Question<NN>> for Question<N>where
N: ToDname,
NN: ToDname,
impl<N, NN> PartialEq<Question<NN>> for Question<N>where N: ToDname, NN: ToDname,
source§impl<N, NN> PartialOrd<Question<NN>> for Question<N>where
N: ToDname,
NN: ToDname,
impl<N, NN> PartialOrd<Question<NN>> for Question<N>where N: ToDname, NN: ToDname,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<N: Copy> Copy for Question<N>
impl<N: ToDname> Eq for Question<N>
Auto Trait Implementations§
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
Mutably borrows from an owned value. Read more
source§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
source§fn try_octets_into(
self
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
source§fn octets_into(self) -> Targetwhere
Self::Error: Into<Infallible>,
fn octets_into(self) -> Targetwhere Self::Error: Into<Infallible>,
Performs an infallible conversion.