You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I randomly thought about this and started looking at it. Based on how this codebase evolved I think the macros are of less use here.
Unlike in rustls-ffi we're not creating new opaque structs for each Castable at the site of implementing that trait and instead we're following a pattern of defining an unexported rust type in a sub module and then exporting a SCREAMING_SNAKE_CASE type alias in entry.rs. That means less boilerplate to motivate the macro.
Similarly, unlike in rustls-ffi we sometimes want the type alias to be for one rust type, but the Castable::RustType to be that type wrapped in NotThreadSafe. Handling that in the macros complicates them, and I think obscures the key detail of the castable being NotThreadSafe or not.
Overall: a nice idea but one I think we should pass on for now.
See rustls/rustls-ffi#404
It would help with the eventual move towards shared FFI helpers if this repo also adopted the
Castable
helper macros recently added in rustls-ffi.Filing this as an issue instead of a PR making the switch to avoid unnecessary conflicts with in-progress work. We can do this at some future point.
The text was updated successfully, but these errors were encountered: