pub trait ComposeRecordData: RecordData {
    // Required methods
    fn rdlen(&self, compress: bool) -> Option<u16>;
    fn compose_rdata<Target: Composer + ?Sized>(
        &self,
        target: &mut Target
    ) -> Result<(), Target::AppendError>;
    fn compose_canonical_rdata<Target: Composer + ?Sized>(
        &self,
        target: &mut Target
    ) -> Result<(), Target::AppendError>;

    // Provided methods
    fn compose_len_rdata<Target: Composer + ?Sized>(
        &self,
        target: &mut Target
    ) -> Result<(), Target::AppendError> { ... }
    fn compose_canonical_len_rdata<Target: Composer + ?Sized>(
        &self,
        target: &mut Target
    ) -> Result<(), Target::AppendError> { ... }
}
Expand description

A type of record data that can be composed.

Required Methods§

source

fn rdlen(&self, compress: bool) -> Option<u16>

Returns the length of the record data if available.

The method should return None, if the length is not known or is not the same for all targets.

If compress is true, name compression is available in the target. If name compression would be used in compose_rdata, the method should None if compress is true since it can’t know the final size.

source

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

Appends the wire format of the record data into target.

source

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

Appends the canonical wire format of the record data into target.

Provided Methods§

source

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

Appends the record data prefixed with its length.

source

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

Appends the record data prefixed with its length.

Implementations on Foreign Types§

source§

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

source§

fn rdlen(&self, compress: bool) -> Option<u16>

source§

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

source§

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

Implementors§

source§

impl ComposeRecordData for Aaaa

source§

impl ComposeRecordData for A

source§

impl<N: ToDname> ComposeRecordData for Dname<N>

source§

impl<N: ToDname> ComposeRecordData for Cname<N>

source§

impl<N: ToDname> ComposeRecordData for Mb<N>

source§

impl<N: ToDname> ComposeRecordData for Md<N>

source§

impl<N: ToDname> ComposeRecordData for Mf<N>

source§

impl<N: ToDname> ComposeRecordData for Mg<N>

source§

impl<N: ToDname> ComposeRecordData for Mr<N>

source§

impl<N: ToDname> ComposeRecordData for Ns<N>

source§

impl<N: ToDname> ComposeRecordData for Ptr<N>

source§

impl<Name: ToDname> ComposeRecordData for Minfo<Name>

source§

impl<Name: ToDname> ComposeRecordData for Mx<Name>

source§

impl<Name: ToDname> ComposeRecordData for Soa<Name>

source§

impl<Name: ToDname> ComposeRecordData for Srv<Name>

source§

impl<Octs, Name> ComposeRecordData for AllRecordData<Octs, Name>where Octs: AsRef<[u8]>, Name: ToDname,

source§

impl<Octs, Name> ComposeRecordData for ZoneRecordData<Octs, Name>where Octs: AsRef<[u8]>, Name: ToDname,

source§

impl<Octs, Name> ComposeRecordData for Nsec<Octs, Name>where Octs: AsRef<[u8]>, Name: ToDname,

source§

impl<Octs, Name> ComposeRecordData for Rrsig<Octs, Name>where Octs: AsRef<[u8]>, Name: ToDname,

source§

impl<Octs: AsRef<[u8]> + ?Sized> ComposeRecordData for Null<Octs>

source§

impl<Octs: AsRef<[u8]> + ?Sized> ComposeRecordData for Opt<Octs>

source§

impl<Octs: AsRef<[u8]>> ComposeRecordData for Cdnskey<Octs>

source§

impl<Octs: AsRef<[u8]>> ComposeRecordData for Cds<Octs>

source§

impl<Octs: AsRef<[u8]>> ComposeRecordData for Dnskey<Octs>

source§

impl<Octs: AsRef<[u8]>> ComposeRecordData for Ds<Octs>

source§

impl<Octs: AsRef<[u8]>> ComposeRecordData for Nsec3<Octs>

source§

impl<Octs: AsRef<[u8]>> ComposeRecordData for Nsec3param<Octs>

source§

impl<Octs: AsRef<[u8]>> ComposeRecordData for Hinfo<Octs>

source§

impl<Octs: AsRef<[u8]>> ComposeRecordData for Txt<Octs>

source§

impl<Octs: AsRef<[u8]>> ComposeRecordData for UnknownRecordData<Octs>

source§

impl<Octs: AsRef<[u8]>, Name: ToDname> ComposeRecordData for Tsig<Octs, Name>

source§

impl<Variant, Octs, Name> ComposeRecordData for SvcbRdata<Variant, Octs, Name>where Self: RecordData, Octs: AsRef<[u8]>, Name: ToDname,