Closed edsky closed 4 years ago
Hi @edsky, I do not know whether you ever solved your problem or not, but for the sake of completeness I'll answer. I'd say your question is more related to the semantics of Rust rather than this library.
The most obvious alternative would be to merely forward the arguments of the closure to the C function:
Test.set_detour(|arg1, arg2| c_function(arg1, arg2));
Test.set_detour(|val| val - 5); to Test.set_detour(c function pointer);?