Normal people: It's my birthday I should do something fun Me: It's my birthday here's 1500 words on how easy it is to bridge `impl FnMut(Thing)` and `void (*)(void*, thing_t)`
-
-
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
You're ignoring unwinding through FFI. That's a big problem here.
- 2 more replies
New conversation -
-
-
oh man first time i saw this i think it was
@nokusu years ago and i was just taken by how simple yet brilliant it was -
Yeah it was 2 years ago that I needed to do this for Diesel. It was a feature that I expected to be way harder than it actually was. Just goes to show how solid Rust's support for FFI is.
- 1 more reply
New conversation -
-
-
Nice! Reminds me the time I just gave the closure address and then moved the pointer to be beyond the vtable and "callable". Unsafe? Maybe a bit haha!
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Actually I think it's how most C bindings are doing to handle callbacks. At least we do something similar in gtk-rs.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Oh my god I’m trying to achieve this because in need to register a callback to objective C when permissions are being requested, I’m gonna give it a try ASAP ! https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/requesting_authorization_for_media_capture_on_macos …
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Can’t say it ever happened to me
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.