domain::base::record

Trait ComposeRecord

Source
pub trait ComposeRecord {
    // Required method
    fn compose_record<Target: Composer + ?Sized>(
        &self,
        target: &mut Target,
    ) -> Result<(), Target::AppendError>;
}
Expand description

A helper trait allowing construction of records on the fly.

The trait’s primary users arer the three record section buider type of the [message builder] system. Their push methods accept anything that implements this trait.

Implementations are provided for Record values and references. In addition, a tuple of a domain name, class, TTL, and record data can be used as this trait, saving the detour of constructing a record first. Since the class is pretty much always Class::In, it can be left out in this case.

Required Methods§

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, T: ComposeRecord> ComposeRecord for &'a T

Source§

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

Source§

impl<Name, Data> ComposeRecord for (Name, Class, u32, Data)
where Name: ToDname, Data: ComposeRecordData,

Source§

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

Source§

impl<Name, Data> ComposeRecord for (Name, Class, Ttl, Data)
where Name: ToDname, Data: ComposeRecordData,

Source§

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

Source§

impl<Name, Data> ComposeRecord for (Name, u32, Data)
where Name: ToDname, Data: ComposeRecordData,

Source§

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

Source§

impl<Name, Data> ComposeRecord for (Name, Ttl, Data)
where Name: ToDname, Data: ComposeRecordData,

Source§

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

Implementors§

Source§

impl<Name, Data> ComposeRecord for Record<Name, Data>
where Name: ToDname, Data: ComposeRecordData,