pub trait WithGeneric: Generic {
// Required methods
fn hmap<U: Generic, F>(self, f: F) -> U
where Self::Repr: HMappable<Poly<F>, Output = U::Repr>;
fn hzip<U: Generic, TU: Generic<Repr = <Self::Repr as HZippable<U::Repr>>::Zipped>>(
self,
other: U,
) -> TU
where Self::Repr: HZippable<U::Repr>;
fn hzip_with<F, U: Generic, TU: Generic<Repr = <<Self::Repr as HZippable<U::Repr>>::Zipped as HMappable<Poly<F>>>::Output>>(
self,
other: U,
f: F,
) -> TU
where Self::Repr: HZippable<U::Repr>,
<Self::Repr as HZippable<U::Repr>>::Zipped: HMappable<Poly<F>>;
fn hzipped_for_each<F, U: Generic>(self, other: U, f: F)
where Self::Repr: HZippable<U::Repr>,
<Self::Repr as HZippable<U::Repr>>::Zipped: ForEach<F>;
fn hzip_to_list<F, U: Generic, O>(
self,
other: U,
f: F,
) -> ConsList<O, <<Self::Repr as HZippable<U::Repr>>::Zipped as MapToList<F, O>>::Output>
where Self::Repr: HZippable<U::Repr>,
<Self::Repr as HZippable<U::Repr>>::Zipped: MapToList<F, O>;
fn map_to_list<F, O>(
self,
f: F,
) -> ConsList<O, <Self::Repr as MapToList<F, O>>::Output>
where Self::Repr: MapToList<F, O>;
fn for_each<F>(self, f: F)
where Self::Repr: ForEach<F>;
fn fields_into_iter<U>(self) -> impl Iterator<Item = U>
where Self::Repr: MapToList<Identity, U>;
}Expand description
Convenience functions for the caller to map between similarly-shaped types implementing Generic without having to explicitly call Generic::from and Generic::into
Required Methods§
fn hmap<U: Generic, F>(self, f: F) -> U
fn hzip<U: Generic, TU: Generic<Repr = <Self::Repr as HZippable<U::Repr>>::Zipped>>( self, other: U, ) -> TU
fn hzip_with<F, U: Generic, TU: Generic<Repr = <<Self::Repr as HZippable<U::Repr>>::Zipped as HMappable<Poly<F>>>::Output>>( self, other: U, f: F, ) -> TU
fn hzipped_for_each<F, U: Generic>(self, other: U, f: F)
fn hzip_to_list<F, U: Generic, O>( self, other: U, f: F, ) -> ConsList<O, <<Self::Repr as HZippable<U::Repr>>::Zipped as MapToList<F, O>>::Output>
fn map_to_list<F, O>( self, f: F, ) -> ConsList<O, <Self::Repr as MapToList<F, O>>::Output>
fn for_each<F>(self, f: F)
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.