mdeloof / statig

Hierarchical state machines for designing event-driven systems
https://crates.io/crates/statig
MIT License
560 stars 18 forks source link

Add ability to derive traits on the final state machine #6

Closed maxwellodri closed 1 year ago

maxwellodri commented 1 year ago

Traits like Clone & serde's (De)serialize come to mind mostly. Something like the proc-macro generating the final state machine's struct directly could work? It'd be nice to have same ability to derive traits similar to deriving them on State/SuperState.

mdeloof commented 1 year ago

Yes, this is definitely something that I'll be adding pretty soon. Thanks for bringing it up!

mdeloof commented 1 year ago

This has been added in d71bd3d04bd0442750d237e9c71e5d11b0a71488. Serde's traits can be enabled with the serde feature.