Trait domain::base::question::ComposeQuestion

source ·
pub trait ComposeQuestion {
    // Required method
    fn compose_question<Target: Composer + ?Sized>(
        &self,
        target: &mut Target,
    ) -> Result<(), Target::AppendError>;
}
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 Methods§

source

fn compose_question<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a, Q: ComposeQuestion> ComposeQuestion for &'a Q

source§

fn compose_question<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

impl<Name: ToName> ComposeQuestion for (Name, Rtype)

source§

fn compose_question<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

impl<Name: ToName> ComposeQuestion for (Name, Rtype, Class)

source§

fn compose_question<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

Implementors§