Trait frunk::traits::Func[][src]

pub trait Func<Input> {
    type Output;
    fn call(i: Input) -> Self::Output;
Expand description

This is a simple, user-implementable alternative to Fn.

Might not be necessary if/when Fn(Once, Mut) traits are implementable in stable Rust

Associated Types

Required methods

Call the Func.

Notice that this does not take a self argument, which in turn means Func cannot effectively close over a context. This decision trades power for convenience; a three-trait Fn heirarchy like that in std provides a great deal of power in a small fraction of use-cases, but it also comes at great expanse to the other 95% of use cases.