3 ms·
> As far as I know, const traits are still on track. Yes they are. My use case is something like the bitflags crate, there are lots of bit flags in emulated d
by bonzini 2y ago
> As far as I know, const traits are still on track.
Yes they are. My use case is something like the bitflags crate, there are lots of bit flags in emulated devices of course. In the meanwhile I guess it would be possible to use macros to turn something like "bit_const!(Type:A|B)" to "Type(A.0|B.0)" or something like that.
> As in, turning a Rust closure into a C function-pointer-plus-context-parameter?
Yes, more in general everything related to callbacks is doable but very verbose. We might do (procedural?) macro magic later on to avoid the verbosity but for now I prefer to stick to pure Rust until there's an idea of which patterns recur.
Let me know by email about any occasions to present what I have.
- 0x457 2y agoI made this handy function to pass callbacks to C: https://github.com/andoriyu/uclicious/blob/master/src/traits.rs#L38-L62 https://github.com/andoriyu/uclicious/blob/master/src/traits...