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
sourceimpl<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.
Trait Implementations
sourceimpl<Name: ToDname> AsQuestion for Question<Name>
impl<Name: ToDname> AsQuestion for Question<Name>
sourceimpl<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,
sourcefn canonical_cmp(&self, other: &Question<NN>) -> Ordering
fn canonical_cmp(&self, other: &Question<NN>) -> Ordering
Returns the canonical ordering between self
and other
.
sourcefn canonical_lt(&self, other: &Rhs) -> bool
fn canonical_lt(&self, other: &Rhs) -> bool
Returns whether self
is canonically less than other
.
sourcefn canonical_le(&self, other: &Rhs) -> bool
fn canonical_le(&self, other: &Rhs) -> bool
Returns whether self
is canonically less than or equal to other
.
sourcefn canonical_gt(&self, other: &Rhs) -> bool
fn canonical_gt(&self, other: &Rhs) -> bool
Returns whether self
is canonically greater than other
.
sourcefn canonical_ge(&self, other: &Rhs) -> bool
fn canonical_ge(&self, other: &Rhs) -> bool
Returns whether self
is canonically greater than or equal to other
.
sourceimpl<N: ToDname> Compose for Question<N>
impl<N: ToDname> Compose for Question<N>
sourcefn compose<T: OctetsBuilder + AsMut<[u8]>>(
&self,
target: &mut T
) -> Result<(), ShortBuf>
fn compose<T: OctetsBuilder + AsMut<[u8]>>(
&self,
target: &mut T
) -> Result<(), ShortBuf>
Appends the concrete representation of the value to the target. Read more
sourcefn compose_canonical<T: OctetsBuilder + AsMut<[u8]>>(
&self,
target: &mut T
) -> Result<(), ShortBuf>
fn compose_canonical<T: OctetsBuilder + AsMut<[u8]>>(
&self,
target: &mut T
) -> Result<(), ShortBuf>
Appends the canonical representation of the value to the target. Read more
sourceimpl<'de, N> Deserialize<'de> for Question<N>where
N: Deserialize<'de>,
impl<'de, N> Deserialize<'de> for Question<N>where
N: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<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>,
sourcefn octets_from(source: Question<SrcName>) -> Result<Self, ShortBuf>
fn octets_from(source: Question<SrcName>) -> Result<Self, ShortBuf>
Performs the conversion.
sourceimpl<N: ToDname> Ord for Question<N>
impl<N: ToDname> Ord for Question<N>
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<Ref: OctetsRef> Parse<Ref> for Question<ParsedDname<Ref>>
impl<Ref: OctetsRef> Parse<Ref> for Question<ParsedDname<Ref>>
sourceimpl<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,
sourceimpl<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,
sourcefn partial_cmp(&self, other: &Question<NN>) -> Option<Ordering>
fn partial_cmp(&self, other: &Question<NN>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl<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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
sourcefn octets_into(self) -> Result<Target, ShortBuf>
fn octets_into(self) -> Result<Target, ShortBuf>
Performs the conversion.