Equivalent of std::bind_front in rust?

60 points iulikrusu

Is there a generic way to implement bind_front in rust?

For those who are not familiar, bind_front takes a function and binds the first N arguments to some fixed value, returning a new function.

You can obviously use a closure for a concrete function, but I'm interested in doing it generically for any number of arguments. Since rust has no variadic generics, I'm not sure how one would implement this.