pub trait OctetsFrom<Source>: Sized {
    // Required method
    fn octets_from(source: Source) -> Result<Self, ShortBuf>;
}
Expand description

Convert a type from one octets type to another.

This trait allows creating a value of a type that is generic over an octets sequence from an identical value using a different type of octets sequence.

This is different from just From in that the conversion may fail if the source sequence is longer than the space available for the target type.

Required Methods§

source

fn octets_from(source: Source) -> Result<Self, ShortBuf>

Performs the conversion.

Implementations on Foreign Types§

source§

impl<Source> OctetsFrom<Source> for Vec<u8>where Self: From<Source>,

source§

fn octets_from(source: Source) -> Result<Self, ShortBuf>

source§

impl<'a, Source: AsRef<[u8]> + 'a> OctetsFrom<&'a Source> for &'a [u8]

source§

impl<Source> OctetsFrom<Source> for Byteswhere Self: From<Source>,

source§

fn octets_from(source: Source) -> Result<Self, ShortBuf>

source§

impl<Source, A> OctetsFrom<Source> for SmallVec<A>where Source: AsRef<[u8]>, A: Array<Item = u8>,

source§

fn octets_from(source: Source) -> Result<Self, ShortBuf>

source§

impl<Source> OctetsFrom<Source> for BytesMutwhere Self: From<Source>,

source§

fn octets_from(source: Source) -> Result<Self, ShortBuf>

Implementors§

source§

impl OctetsFrom<A> for A

source§

impl OctetsFrom<Aaaa> for Aaaa

source§

impl<Name, Data, SrcName, SrcData> OctetsFrom<Record<SrcName, SrcData>> for Record<Name, Data>where Name: OctetsFrom<SrcName>, Data: OctetsFrom<SrcData>,

source§

impl<Name, SrcName> OctetsFrom<Cname<SrcName>> for Cname<Name>where Name: OctetsFrom<SrcName>,

source§

impl<Name, SrcName> OctetsFrom<Mb<SrcName>> for Mb<Name>where Name: OctetsFrom<SrcName>,

source§

impl<Name, SrcName> OctetsFrom<Md<SrcName>> for Md<Name>where Name: OctetsFrom<SrcName>,

source§

impl<Name, SrcName> OctetsFrom<Mf<SrcName>> for Mf<Name>where Name: OctetsFrom<SrcName>,

source§

impl<Name, SrcName> OctetsFrom<Mg<SrcName>> for Mg<Name>where Name: OctetsFrom<SrcName>,

source§

impl<Name, SrcName> OctetsFrom<Minfo<SrcName>> for Minfo<Name>where Name: OctetsFrom<SrcName>,

source§

impl<Name, SrcName> OctetsFrom<Mr<SrcName>> for Mr<Name>where Name: OctetsFrom<SrcName>,

source§

impl<Name, SrcName> OctetsFrom<Mx<SrcName>> for Mx<Name>where Name: OctetsFrom<SrcName>,

source§

impl<Name, SrcName> OctetsFrom<Ns<SrcName>> for Ns<Name>where Name: OctetsFrom<SrcName>,

source§

impl<Name, SrcName> OctetsFrom<Ptr<SrcName>> for Ptr<Name>where Name: OctetsFrom<SrcName>,

source§

impl<Name, SrcName> OctetsFrom<Soa<SrcName>> for Soa<Name>where Name: OctetsFrom<SrcName>,

source§

impl<Name, SrcName> OctetsFrom<Srv<SrcName>> for Srv<Name>where Name: OctetsFrom<SrcName>,

source§

impl<Name, SrcName> OctetsFrom<ProtoRrsig<SrcName>> for ProtoRrsig<Name>where Name: OctetsFrom<SrcName>,

source§

impl<Name, SrcName> OctetsFrom<Dname<SrcName>> for domain::rdata::rfc6672::Dname<Name>where Name: OctetsFrom<SrcName>,

source§

impl<Name, SrcName> OctetsFrom<Question<SrcName>> for Question<Name>where Name: OctetsFrom<SrcName>,

source§

impl<O, OO> OctetsFrom<Alpn<O>> for Alpn<OO>where OO: OctetsFrom<O>,

source§

impl<O, OO> OctetsFrom<DohPath<O>> for DohPath<OO>where OO: OctetsFrom<O>,

source§

impl<O, OO> OctetsFrom<Ech<O>> for Ech<OO>where OO: OctetsFrom<O>,

source§

impl<O, OO> OctetsFrom<Ipv4Hint<O>> for Ipv4Hint<OO>where OO: OctetsFrom<O>,

source§

impl<O, OO> OctetsFrom<Ipv6Hint<O>> for Ipv6Hint<OO>where OO: OctetsFrom<O>,

source§

impl<O, OO> OctetsFrom<Mandatory<O>> for Mandatory<OO>where OO: OctetsFrom<O>,

source§

impl<O, OO, N, NN> OctetsFrom<Https<O, N>> for Https<OO, NN>where OO: OctetsFrom<O>, NN: OctetsFrom<N>,

source§

impl<O, OO, N, NN> OctetsFrom<Svcb<O, N>> for Svcb<OO, NN>where OO: OctetsFrom<O>, NN: OctetsFrom<N>,

source§

impl<Octets, SrcOctets> OctetsFrom<Hinfo<SrcOctets>> for Hinfo<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets> OctetsFrom<Null<SrcOctets>> for Null<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets> OctetsFrom<Txt<SrcOctets>> for Txt<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets> OctetsFrom<Dnskey<SrcOctets>> for Dnskey<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets> OctetsFrom<Ds<SrcOctets>> for Ds<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets> OctetsFrom<RtypeBitmap<SrcOctets>> for RtypeBitmap<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets> OctetsFrom<Nsec3<SrcOctets>> for Nsec3<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets> OctetsFrom<Nsec3Salt<SrcOctets>> for Nsec3Salt<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets> OctetsFrom<Nsec3param<SrcOctets>> for Nsec3param<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets> OctetsFrom<OwnerHash<SrcOctets>> for OwnerHash<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets> OctetsFrom<Cdnskey<SrcOctets>> for Cdnskey<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets> OctetsFrom<Cds<SrcOctets>> for Cds<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets> OctetsFrom<CharStr<SrcOctets>> for CharStr<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets> OctetsFrom<Message<SrcOctets>> for Message<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets> OctetsFrom<Dname<SrcOctets>> for domain::base::name::Dname<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets> OctetsFrom<RelativeDname<SrcOctets>> for RelativeDname<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets> OctetsFrom<Opt<SrcOctets>> for Opt<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets> OctetsFrom<OptRecord<SrcOctets>> for OptRecord<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets> OctetsFrom<UnknownRecordData<SrcOctets>> for UnknownRecordData<Octets>where Octets: OctetsFrom<SrcOctets>,

source§

impl<Octets, SrcOctets, Name, SrcName> OctetsFrom<AllRecordData<SrcOctets, SrcName>> for AllRecordData<Octets, Name>where Octets: OctetsFrom<SrcOctets>, Name: OctetsFrom<SrcName>,

source§

impl<Octets, SrcOctets, Name, SrcName> OctetsFrom<ZoneRecordData<SrcOctets, SrcName>> for ZoneRecordData<Octets, Name>where Octets: OctetsFrom<SrcOctets>, Name: OctetsFrom<SrcName>,

source§

impl<Octets, SrcOctets, Name, SrcName> OctetsFrom<Tsig<SrcOctets, SrcName>> for Tsig<Octets, Name>where Octets: OctetsFrom<SrcOctets>, Name: OctetsFrom<SrcName>,

source§

impl<Octets, SrcOctets, Name, SrcName> OctetsFrom<Nsec<SrcOctets, SrcName>> for Nsec<Octets, Name>where Octets: OctetsFrom<SrcOctets>, Name: OctetsFrom<SrcName>,

source§

impl<Octets, SrcOctets, Name, SrcName> OctetsFrom<Rrsig<SrcOctets, SrcName>> for Rrsig<Octets, Name>where Octets: OctetsFrom<SrcOctets>, Name: OctetsFrom<SrcName>,