Trait Iso

Source
pub trait Iso: View
where Self::V: SpecIso<Src = <Self::SrcOwned as View>::V, Dst = <Self::DstOwned as View>::V>, <Self::SrcOwned as View>::V: SpecFrom<<Self::DstOwned as View>::V>, <Self::DstOwned as View>::V: SpecFrom<<Self::SrcOwned as View>::V>,
{ type Src<'a>: View<V = <Self::SrcOwned as View>::V> + From<Self::Dst<'a>>; type Dst<'a>: View<V = <Self::DstOwned as View>::V> + From<Self::Src<'a>>; type SrcOwned: View + From<Self::DstOwned> where <Self::SrcOwned as View>::V: SpecFrom<<Self::DstOwned as View>::V>; type DstOwned: View + From<Self::SrcOwned> where <Self::DstOwned as View>::V: SpecFrom<<Self::SrcOwned as View>::V>; // Provided methods fn apply(s: Self::Src<'_>) -> Self::Dst<'_> { ... } fn rev_apply(s: Self::Dst<'_>) -> Self::Src<'_> { ... } }
Expand description

All isomorphisms to be used in Mapped combinator must implement this trait. Self::apply and Self::rev_apply must be inverses of each other. See [SpecIso::spec_iso] and [SpecIso::spec_iso_rev] for more details.

Required Associated Types§

Source

type Src<'a>: View<V = <Self::SrcOwned as View>::V> + From<Self::Dst<'a>>

The source type of the isomorphism.

Source

type Dst<'a>: View<V = <Self::DstOwned as View>::V> + From<Self::Src<'a>>

The destination type of the isomorphism.

Source

type SrcOwned: View + From<Self::DstOwned> where <Self::SrcOwned as View>::V: SpecFrom<<Self::DstOwned as View>::V>

The owned version of the source type.

Source

type DstOwned: View + From<Self::SrcOwned> where <Self::DstOwned as View>::V: SpecFrom<<Self::SrcOwned as View>::V>

The owned version of the destination type.

Provided Methods§

Source

fn apply(s: Self::Src<'_>) -> Self::Dst<'_>

Applies the isomorphism to the source type.

Source

fn rev_apply(s: Self::Dst<'_>) -> Self::Src<'_>

Applies the reverse isomorphism to the destination type.

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.

Implementors§

Source§

impl Iso for AlgorithmIdentifierMapper

Source§

type Src<'a> = (ObjectIdentifierValue, PolyType<<OrdChoice<ASN1<Null>, End> as Combinator>::Result<'a>, <OrdChoice<ASN1<Null>, End> as Combinator>::Result<'a>, <OrdChoice<ASN1<Null>, End> as Combinator>::Result<'a>, <OrdChoice<ASN1<Null>, End> as Combinator>::Result<'a>, <OrdChoice<ASN1<DSAParam>, End> as Combinator>::Result<'a>, <End as Combinator>::Result<'a>, <End as Combinator>::Result<'a>, <End as Combinator>::Result<'a>, <End as Combinator>::Result<'a>, <OrdChoice<ASN1<Null>, End> as Combinator>::Result<'a>, <ASN1<ObjectIdentifier> as Combinator>::Result<'a>, <Tail as Combinator>::Result<'a>>)

Source§

type Dst<'a> = AlgorithmIdentifierPoly<ObjectIdentifierValue, PolyType<<OrdChoice<ASN1<Null>, End> as Combinator>::Result<'a>, <OrdChoice<ASN1<Null>, End> as Combinator>::Result<'a>, <OrdChoice<ASN1<Null>, End> as Combinator>::Result<'a>, <OrdChoice<ASN1<Null>, End> as Combinator>::Result<'a>, <OrdChoice<ASN1<DSAParam>, End> as Combinator>::Result<'a>, <End as Combinator>::Result<'a>, <End as Combinator>::Result<'a>, <End as Combinator>::Result<'a>, <End as Combinator>::Result<'a>, <OrdChoice<ASN1<Null>, End> as Combinator>::Result<'a>, <ASN1<ObjectIdentifier> as Combinator>::Result<'a>, <Tail as Combinator>::Result<'a>>>

Source§

type SrcOwned = (ObjectIdentifierValue, PolyType<<OrdChoice<ASN1<Null>, End> as Combinator>::Owned, <OrdChoice<ASN1<Null>, End> as Combinator>::Owned, <OrdChoice<ASN1<Null>, End> as Combinator>::Owned, <OrdChoice<ASN1<Null>, End> as Combinator>::Owned, <OrdChoice<ASN1<DSAParam>, End> as Combinator>::Owned, <End as Combinator>::Owned, <End as Combinator>::Owned, <End as Combinator>::Owned, <End as Combinator>::Owned, <OrdChoice<ASN1<Null>, End> as Combinator>::Owned, <ASN1<ObjectIdentifier> as Combinator>::Owned, <Tail as Combinator>::Owned>)

Source§

type DstOwned = AlgorithmIdentifierPoly<ObjectIdentifierValue, PolyType<<OrdChoice<ASN1<Null>, End> as Combinator>::Owned, <OrdChoice<ASN1<Null>, End> as Combinator>::Owned, <OrdChoice<ASN1<Null>, End> as Combinator>::Owned, <OrdChoice<ASN1<Null>, End> as Combinator>::Owned, <OrdChoice<ASN1<DSAParam>, End> as Combinator>::Owned, <End as Combinator>::Owned, <End as Combinator>::Owned, <End as Combinator>::Owned, <End as Combinator>::Owned, <OrdChoice<ASN1<Null>, End> as Combinator>::Owned, <ASN1<ObjectIdentifier> as Combinator>::Owned, <Tail as Combinator>::Owned>>

Source§

impl Iso for ExtensionMapper

Source§

type Src<'a> = (ObjectIdentifierValue, PairValue<OptionDeep<bool>, PolyType<<ASN1<ExplicitTag<ASN1<AuthorityKeyIdentifier>>> as Combinator>::Result<'a>, <ASN1<ExplicitTag<ASN1<OctetString>>> as Combinator>::Result<'a>, <ASN1<ExplicitTag<ASN1<BasicConstraints>>> as Combinator>::Result<'a>, <ASN1<ExplicitTag<ASN1<CertificatePolicies>>> as Combinator>::Result<'a>, <ASN1<ExplicitTag<ASN1<ExtendedKeyUsage>>> as Combinator>::Result<'a>, <ASN1<ExplicitTag<ASN1<BitString>>> as Combinator>::Result<'a>, <ASN1<ExplicitTag<ASN1<GeneralNames>>> as Combinator>::Result<'a>, <ASN1<ExplicitTag<ASN1<NameConstraints>>> as Combinator>::Result<'a>, <ASN1<ExplicitTag<ASN1<AuthorityInfoAccess>>> as Combinator>::Result<'a>, <ASN1<OctetString> as Combinator>::Result<'a>>>)

Source§

type Dst<'a> = ExtensionPoly<ObjectIdentifierValue, PolyType<<ASN1<ExplicitTag<ASN1<AuthorityKeyIdentifier>>> as Combinator>::Result<'a>, <ASN1<ExplicitTag<ASN1<OctetString>>> as Combinator>::Result<'a>, <ASN1<ExplicitTag<ASN1<BasicConstraints>>> as Combinator>::Result<'a>, <ASN1<ExplicitTag<ASN1<CertificatePolicies>>> as Combinator>::Result<'a>, <ASN1<ExplicitTag<ASN1<ExtendedKeyUsage>>> as Combinator>::Result<'a>, <ASN1<ExplicitTag<ASN1<BitString>>> as Combinator>::Result<'a>, <ASN1<ExplicitTag<ASN1<GeneralNames>>> as Combinator>::Result<'a>, <ASN1<ExplicitTag<ASN1<NameConstraints>>> as Combinator>::Result<'a>, <ASN1<ExplicitTag<ASN1<AuthorityInfoAccess>>> as Combinator>::Result<'a>, <ASN1<OctetString> as Combinator>::Result<'a>>>

Source§

type SrcOwned = (ObjectIdentifierValue, PairValue<OptionDeep<bool>, PolyType<<ASN1<ExplicitTag<ASN1<AuthorityKeyIdentifier>>> as Combinator>::Owned, <ASN1<ExplicitTag<ASN1<OctetString>>> as Combinator>::Owned, <ASN1<ExplicitTag<ASN1<BasicConstraints>>> as Combinator>::Owned, <ASN1<ExplicitTag<ASN1<CertificatePolicies>>> as Combinator>::Owned, <ASN1<ExplicitTag<ASN1<ExtendedKeyUsage>>> as Combinator>::Owned, <ASN1<ExplicitTag<ASN1<BitString>>> as Combinator>::Owned, <ASN1<ExplicitTag<ASN1<GeneralNames>>> as Combinator>::Owned, <ASN1<ExplicitTag<ASN1<NameConstraints>>> as Combinator>::Owned, <ASN1<ExplicitTag<ASN1<AuthorityInfoAccess>>> as Combinator>::Owned, <ASN1<OctetString> as Combinator>::Owned>>)

Source§

type DstOwned = ExtensionPoly<ObjectIdentifierValue, PolyType<<ASN1<ExplicitTag<ASN1<AuthorityKeyIdentifier>>> as Combinator>::Owned, <ASN1<ExplicitTag<ASN1<OctetString>>> as Combinator>::Owned, <ASN1<ExplicitTag<ASN1<BasicConstraints>>> as Combinator>::Owned, <ASN1<ExplicitTag<ASN1<CertificatePolicies>>> as Combinator>::Owned, <ASN1<ExplicitTag<ASN1<ExtendedKeyUsage>>> as Combinator>::Owned, <ASN1<ExplicitTag<ASN1<BitString>>> as Combinator>::Owned, <ASN1<ExplicitTag<ASN1<GeneralNames>>> as Combinator>::Owned, <ASN1<ExplicitTag<ASN1<NameConstraints>>> as Combinator>::Owned, <ASN1<ExplicitTag<ASN1<AuthorityInfoAccess>>> as Combinator>::Owned, <ASN1<OctetString> as Combinator>::Owned>>

Source§

impl<C: Combinator> Iso for IdentityMapper<C>
where C::V: SecureSpecCombinator<SpecResult = <C::Owned as View>::V>,

Source§

type Src<'a> = <C as Combinator>::Result<'a>

Source§

type Dst<'a> = <C as Combinator>::Result<'a>

Source§

type SrcOwned = <C as Combinator>::Owned

Source§

type DstOwned = <C as Combinator>::Owned