pub struct Poly<T>(pub T);Expand description
Wrapper type around a function for polymorphic maps and folds.
This is a thin generic wrapper type that is used to differentiate
between single-typed generic closures F that implements, say, Fn(i8) -> bool,
and a Poly-typed F that implements multiple Function types
via the Func trait. (say, Func<i8, Output=bool> and Func<bool, Output=f32>)
This is needed because there are completely generic impls for many of the HList traits that take a simple unwrapped closure.
Tuple Fields§
§0: TTrait Implementations§
Source§impl<P, R, CH, CTail> CoproductFoldable<Poly<P>, R> for Coproduct<CH, CTail>
impl<P, R, CH, CTail> CoproductFoldable<Poly<P>, R> for Coproduct<CH, CTail>
Source§impl<'a, P, CH, CTail> CoproductMappable<&'a Poly<P>> for Coproduct<CH, CTail>
Implementation for mapping a Coproduct using a &poly_fn!.
impl<'a, P, CH, CTail> CoproductMappable<&'a Poly<P>> for Coproduct<CH, CTail>
Implementation for mapping a Coproduct using a &poly_fn!.
Source§impl<'a, P, CH, CTail> CoproductMappable<&'a mut Poly<P>> for Coproduct<CH, CTail>
Implementation for mapping a Coproduct using a &mut poly_fn!.
impl<'a, P, CH, CTail> CoproductMappable<&'a mut Poly<P>> for Coproduct<CH, CTail>
Implementation for mapping a Coproduct using a &mut poly_fn!.
Source§impl<P, CH, CTail> CoproductMappable<Poly<P>> for Coproduct<CH, CTail>
Implementation for mapping a Coproduct using a poly_fn!.
impl<P, CH, CTail> CoproductMappable<Poly<P>> for Coproduct<CH, CTail>
Implementation for mapping a Coproduct using a poly_fn!.
Source§impl<P, R, H, Tail, Acc> HFoldLeftable<Poly<P>, Acc> for HCons<H, Tail>
impl<P, R, H, Tail, Acc> HFoldLeftable<Poly<P>, Acc> for HCons<H, Tail>
Source§impl<P, R, H, Tail, Init> HFoldRightable<Poly<P>, Init> for HCons<H, Tail>where
Tail: HFoldRightable<Poly<P>, Init>,
P: Func<(<Tail as HFoldRightable<Poly<P>, Init>>::Output, H), Output = R>,
impl<P, R, H, Tail, Init> HFoldRightable<Poly<P>, Init> for HCons<H, Tail>where
Tail: HFoldRightable<Poly<P>, Init>,
P: Func<(<Tail as HFoldRightable<Poly<P>, Init>>::Output, H), Output = R>,
impl<T: Copy> Copy for Poly<T>
Auto Trait Implementations§
impl<T> Freeze for Poly<T>where
T: Freeze,
impl<T> RefUnwindSafe for Poly<T>where
T: RefUnwindSafe,
impl<T> Send for Poly<T>where
T: Send,
impl<T> Sync for Poly<T>where
T: Sync,
impl<T> Unpin for Poly<T>where
T: Unpin,
impl<T> UnwindSafe for Poly<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more