[][src]Trait domain::base::question::AsQuestion

pub trait AsQuestion {
    type Name: ToDname;
    fn qname(&self) -> &Self::Name;
fn qtype(&self) -> Rtype;
fn qclass(&self) -> Class; fn compose_question<T: OctetsBuilder>(
        &self,
        target: &mut T
    ) -> Result<(), ShortBuf>
    where
        Self::Name: Compose
, { ... }
fn compose_question_canonical<T: OctetsBuilder>(
        &self,
        target: &mut T
    ) -> Result<(), ShortBuf>
    where
        Self::Name: Compose
, { ... } }

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

type Name: ToDname

The domain name used by the qname.

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.

Loading content...

Provided methods

fn compose_question<T: OctetsBuilder>(
    &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

Produces the canoncial encoding of the question.

Loading content...

Implementations on Foreign Types

impl<'a, T: AsQuestion> AsQuestion for &'a T[src]

type Name = T::Name

impl<Name: ToDname> AsQuestion for (Name, Rtype, Class)[src]

type Name = Name

impl<Name: ToDname> AsQuestion for (Name, Rtype)[src]

type Name = Name

Loading content...

Implementors

impl<Name: ToDname> AsQuestion for Question<Name>[src]

type Name = Name

Loading content...