Struct frunk_core::traits::Poly
source · 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: T
Trait Implementations
sourceimpl<P, R, CH, CTail> CoproductFoldable<Poly<P>, R> for Coproduct<CH, CTail>where
P: Func<CH, Output = R>,
CTail: CoproductFoldable<Poly<P>, R>,
impl<P, R, CH, CTail> CoproductFoldable<Poly<P>, R> for Coproduct<CH, CTail>where
P: Func<CH, Output = R>,
CTail: CoproductFoldable<Poly<P>, R>,
sourceimpl<P, H, Tail> HMappable<Poly<P>> for HCons<H, Tail>where
P: Func<H>,
Tail: HMappable<Poly<P>>,
impl<P, H, Tail> HMappable<Poly<P>> for HCons<H, Tail>where
P: Func<H>,
Tail: HMappable<Poly<P>>,
impl<T: Copy> Copy for Poly<T>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more