pub trait Iso: Viewwhere
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§
Sourcetype Src<'a>: View<V = <Self::SrcOwned as View>::V> + From<Self::Dst<'a>>
type Src<'a>: View<V = <Self::SrcOwned as View>::V> + From<Self::Dst<'a>>
The source type of the isomorphism.
Sourcetype Dst<'a>: View<V = <Self::DstOwned as View>::V> + From<Self::Src<'a>>
type Dst<'a>: View<V = <Self::DstOwned as View>::V> + From<Self::Src<'a>>
The destination type of the isomorphism.
Provided Methods§
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.