[][src]Struct frunk::traits::Poly

pub struct Poly<T>(pub T);

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.

Trait Implementations

impl<T> Clone for Poly<T> where
    T: Clone
[src]

impl<P, R, CH, CTail> CoproductFoldable<Poly<P>, R> for Coproduct<CH, CTail> where
    CTail: CoproductFoldable<Poly<P>, R>,
    P: Func<CH, Output = R>, 
[src]

impl<T> Copy for Poly<T> where
    T: Copy
[src]

impl<T> Debug for Poly<T> where
    T: Debug
[src]

impl<T> Default for Poly<T> where
    T: Default
[src]

impl<P, H, Tail> HMappable<Poly<P>> for HCons<H, Tail> where
    P: Func<H>,
    Tail: HMappable<Poly<P>>, 
[src]

type Output = HCons<<P as Func<H>>::Output, <Tail as HMappable<Poly<P>>>::Output>

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Choices> CoproductSubsetter<CNil, HNil> for Choices[src]

type Remainder = Choices

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U, I> LiftInto<U, I> for T where
    U: LiftFrom<T, I>, 
[src]

impl<Source> Sculptor<HNil, HNil> for Source[src]

type Remainder = Source

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.