[−][src]Trait domain::base::question::AsQuestion
A helper trait allowing construction of questions on the fly.
The trait’s primary user is the QuestionBuilder
type of the message
builder system. It’s push
method accepts anything that implements
this trait.
Implementations are provided for Question
values and references. In
addition, a tuple of a domain name, record type and class can be used as
this trait, saving the detour of constructing a question first. Since
the class is pretty much always Class::In
, a tuple of just a domain
name and record type works as well by assuming that class.
Associated Types
Loading content...Required methods
fn qname(&self) -> &Self::Name
Returns a reference to the qname of the question.
fn qtype(&self) -> Rtype
Returns the record type of the question.
fn qclass(&self) -> Class
Returns the class of the question.
Provided methods
fn compose_question<T: OctetsBuilder>(
&self,
target: &mut T
) -> Result<(), ShortBuf> where
Self::Name: Compose,
&self,
target: &mut T
) -> Result<(), ShortBuf> where
Self::Name: Compose,
Produces the encoding of the question.
fn compose_question_canonical<T: OctetsBuilder>(
&self,
target: &mut T
) -> Result<(), ShortBuf> where
Self::Name: Compose,
&self,
target: &mut T
) -> Result<(), ShortBuf> where
Self::Name: Compose,
Produces the canoncial encoding of the question.