cxx
cxx copied to clipboard
CxxFunction + rust::Closure
It would be nice to have an effortless way to pass closures across ffi boundaries.
- Similar to
CxxVectorin Rust, there could be aCxxFunctionthat wraps astd::functionand allows calling it. - Similar to
rust::Vecin C++, there could be arust::Fnthat wraps a RustBox<dyn Fn>and allows calling it. Note that to be actually useful, this would have to be combined with generic support as proposed in https://github.com/dtolnay/cxx/issues/683