How do I convert a Rust closure to a C-style callback?
You cannot do it unless the C API allows passing a user-provided callback parameter. If it does not, you can only use static functions. The reason is that closures are not “just” functions. As their name implies, closures “close over” variables from their lexical scope. Each closure has an associated piece of data which holds … Read more