Trait domain::base::octets::Compose

source ·
pub trait Compose {
    // Required method
    fn compose<T: OctetsBuilder + AsMut<[u8]>>(
        &self,
        target: &mut T
    ) -> Result<(), ShortBuf>;

    // Provided method
    fn compose_canonical<T: OctetsBuilder + AsMut<[u8]>>(
        &self,
        target: &mut T
    ) -> Result<(), ShortBuf> { ... }
}
Expand description

A type that knows how to compose itself into an octets builder.

The term ‘composing’ refers to the process of creating a DNS wire-format representation of a value’s data by appending this representation to the end of an octets builder.

The trait supports two different representations: a concrete and a canonical representation. The former represents the actual data of the value. For instance, it reflects the capitalisation of strings. The canonical representation is used when calculating digests or ordering values. Typically, it ignores capitalization and never compresses domain names. See the documentation of CanonicalOrd for more details on canonical representation.

Required Methods§

source

fn compose<T: OctetsBuilder + AsMut<[u8]>>( &self, target: &mut T ) -> Result<(), ShortBuf>

Appends the concrete representation of the value to the target.

If the representation doesn’t fit into the builder, returns an error. In this case the target is considered undefined. If it is supposed to be reused, it needs to be reset specifically.

Provided Methods§

source

fn compose_canonical<T: OctetsBuilder + AsMut<[u8]>>( &self, target: &mut T ) -> Result<(), ShortBuf>

Appends the canonical representation of the value to the target.

If the representation doesn’t fit into the builder, returns an error. In this case the target is considered undefined. If it is supposed to be reused, it needs to be reset specifically.

Implementations on Foreign Types§

source§

impl Compose for u32

source§

fn compose<T: OctetsBuilder + AsMut<[u8]>>( &self, target: &mut T ) -> Result<(), ShortBuf>

source§

impl Compose for i8

source§

fn compose<T: OctetsBuilder + AsMut<[u8]>>( &self, target: &mut T ) -> Result<(), ShortBuf>

source§

impl Compose for u8

source§

fn compose<T: OctetsBuilder + AsMut<[u8]>>( &self, target: &mut T ) -> Result<(), ShortBuf>

source§

impl Compose for i32

source§

fn compose<T: OctetsBuilder + AsMut<[u8]>>( &self, target: &mut T ) -> Result<(), ShortBuf>

source§

impl Compose for i16

source§

fn compose<T: OctetsBuilder + AsMut<[u8]>>( &self, target: &mut T ) -> Result<(), ShortBuf>

source§

impl Compose for u16

source§

fn compose<T: OctetsBuilder + AsMut<[u8]>>( &self, target: &mut T ) -> Result<(), ShortBuf>

source§

impl<'a, C: Compose + ?Sized> Compose for &'a C

source§

fn compose<T: OctetsBuilder + AsMut<[u8]>>( &self, target: &mut T ) -> Result<(), ShortBuf>

source§

fn compose_canonical<T: OctetsBuilder + AsMut<[u8]>>( &self, target: &mut T ) -> Result<(), ShortBuf>

Implementors§

source§

impl Compose for Class

source§

impl Compose for DigestAlg

source§

impl Compose for ExtendedErrorCode

source§

impl Compose for Nsec3HashAlg

source§

impl Compose for Opcode

source§

impl Compose for OptionCode

source§

impl Compose for TsigRcode

source§

impl Compose for Rtype

source§

impl Compose for SecAlg

source§

impl Compose for SvcbParamKey

source§

impl Compose for A

source§

impl Compose for Time48

source§

impl Compose for Aaaa

source§

impl Compose for NoDefaultAlpn

source§

impl Compose for Port

source§

impl Compose for HeaderSection

source§

impl Compose for Label

source§

impl Compose for Ipv4Addr

source§

impl Compose for Ipv6Addr

source§

impl Compose for Expire

source§

impl Compose for TcpKeepalive

source§

impl Compose for Padding

source§

impl Compose for ClientSubnet

source§

impl Compose for OptHeader

source§

impl Compose for OptionHeader

source§

impl Compose for Serial

source§

impl<L: ToRelativeDname, R: ToEitherDname> Compose for domain::base::name::Chain<L, R>

source§

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

source§

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

source§

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

source§

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

source§

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

source§

impl<N: ToDname> Compose for Minfo<N>

source§

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

source§

impl<N: ToDname> Compose for Mx<N>

source§

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

source§

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

source§

impl<N: ToDname> Compose for Soa<N>

source§

impl<N: ToDname> Compose for domain::rdata::rfc6672::Dname<N>

source§

impl<N: ToDname> Compose for Question<N>

source§

impl<N: ToDname, D: RecordData> Compose for Record<N, D>

source§

impl<N: Compose> Compose for Srv<N>

source§

impl<Name: Compose> Compose for ProtoRrsig<Name>

source§

impl<Name: Compose> Compose for RecordHeader<Name>

source§

impl<O, N> Compose for AllRecordData<O, N>where O: AsRef<[u8]>, N: ToDname,

source§

impl<O, N> Compose for ZoneRecordData<O, N>where O: AsRef<[u8]>, N: ToDname,

source§

impl<O: AsRef<[u8]>> Compose for AllParams<O>

source§

impl<O: AsRef<[u8]>> Compose for Alpn<O>

source§

impl<O: AsRef<[u8]>> Compose for DohPath<O>

source§

impl<O: AsRef<[u8]>> Compose for Ech<O>

source§

impl<O: AsRef<[u8]>> Compose for Ipv4Hint<O>

source§

impl<O: AsRef<[u8]>> Compose for Ipv6Hint<O>

source§

impl<O: AsRef<[u8]>> Compose for Mandatory<O>

source§

impl<O: AsRef<[u8]>> Compose for Unknown<O>

source§

impl<O: AsRef<[u8]>, N: Compose> Compose for Tsig<O, N>

source§

impl<O: AsRef<[u8]>, N: Compose> Compose for Https<O, N>

source§

impl<O: AsRef<[u8]>, N: Compose> Compose for Svcb<O, N>

source§

impl<Octets, R> Compose for domain::base::name::Chain<UncertainDname<Octets>, R>where Octets: AsRef<[u8]>, R: ToDname,

source§

impl<Octets: AsRef<[u8]> + ?Sized> Compose for Nsec3Salt<Octets>

source§

impl<Octets: AsRef<[u8]> + ?Sized> Compose for OwnerHash<Octets>

source§

impl<Octets: AsRef<[u8]> + ?Sized> Compose for CharStr<Octets>

source§

impl<Octets: AsRef<[u8]> + ?Sized> Compose for domain::base::name::Dname<Octets>

source§

impl<Octets: AsRef<[u8]> + ?Sized> Compose for RelativeDname<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for UncertainDname<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for AllOptData<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for Hinfo<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for Null<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for Txt<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for Dnskey<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for Ds<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for RtypeBitmap<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for Nsec3<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for Nsec3param<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for Cdnskey<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for Cds<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for Nsid<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for Dau<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for Dhu<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for N3u<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for domain::base::opt::rfc7901::Chain<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for KeyTag<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for ExtendedError<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for Opt<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for UnknownOptData<Octets>

source§

impl<Octets: AsRef<[u8]>> Compose for UnknownRecordData<Octets>

source§

impl<Octets: AsRef<[u8]>, Name: Compose> Compose for Nsec<Octets, Name>

source§

impl<Octets: AsRef<[u8]>, Name: Compose> Compose for Rrsig<Octets, Name>

source§

impl<Ref: AsRef<[u8]>> Compose for ParsedDname<Ref>