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>
§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<ParsedDname<Octs>>
impl<Octs> Question<ParsedDname<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
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> PartialOrd<Question<NN>> for Question<N>
impl<N, NN> PartialOrd<Question<NN>> for Question<N>
impl<N: Copy> Copy for Question<N>
impl<N: ToDname> 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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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) -> Target
fn octets_into(self) -> Target
Performs an infallible conversion.