pub trait AsQuestion {
    type Name: ToDname;

    fn qname(&self) -> &Self::Name;
    fn qtype(&self) -> Rtype;
    fn qclass(&self) -> Class;

    fn compose_question<T: OctetsBuilder + AsMut<[u8]>>(
        &self,
        target: &mut T
    ) -> Result<(), ShortBuf>
   where
        Self::Name: Compose
, { ... } fn compose_question_canonical<T: OctetsBuilder + AsMut<[u8]>>(
        &self,
        target: &mut T
    ) -> Result<(), ShortBuf>
   where
        Self::Name: Compose
, { ... } }
Expand description

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.

Required Associated Types

The domain name used by the qname.

Required Methods

Returns a reference to the qname of the question.

Returns the record type of the question.

Returns the class of the question.

Provided Methods

Produces the encoding of the question.

Produces the canoncial encoding of the question.

Implementations on Foreign Types

Implementors