Function hlua_badtouch::function4
[−]
[src]
pub fn function4<Z, R, A, B, C, D>(f: Z) -> Function<Z, (A, B, C, D), R> where
Z: FnMut(A, B, C, D) -> R,
Wraps a type that implements FnMut
so that it can be used by hlua.
This is needed because of a limitation in Rust's inferrence system. Even though in
practice functions and closures always have a fixed number of parameters, the FnMut
trait of Rust was designed so that it allows calling the same closure with a varying
number of parameters. The consequence however is that there is no way of inferring
with the trait alone many parameters a function or closure expects.