PFn
Provide fn_trait's
call,
call_mut, and
call_once
on Stable Rust for functions / closures with ≤ 12 arguments.
Examples
Basic usage
let closure = ;
// Once the `fn_trait` feature has stabilized, you would do this.
let result = closure.call;
// For now, use PFn.
let result = closure.pfn_call;
Generalizing over functions with different number of arguments
// Here, Func can be a function or closure that takes any number of arguments (actually 1 - 12 arguments).
let runnable = Runnable ;
assert_eq!;