oxidecomputer / idolatry

An experimental IPC interface definition language for Hubris.
Mozilla Public License 2.0
17 stars 11 forks source link

idol: API to derive additional traits for op enums #49

Closed hawkw closed 7 months ago

hawkw commented 7 months ago

This commit adds a new API to idol::Generator to add a list of additional traits to derive for the generated Operation enum type. This is motivated by the desire to derive counters::Count for the SpiOperation enum, as it's used in ringbuf entries in drv-stm32xx-spi-server-core, which I would like to be able to count occurences of. But, it may be useful for other purposes as well.