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

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Use functions to fold a coproduct into a single value. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Perform a left fold over an HList. Read more

Perform a right fold over an HList. Read more

Apply a function to each element of an HList. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Extract a subset of the possible types in a coproduct (or get the remaining possibilities) Read more

Performs the conversion.

Performs the conversion.

Performs the indexed conversion.

Consumes the current HList and returns an HList with the requested shape. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.