Patterns for Modeling Overlapping Variant Data in Rust
Patterns for Modeling Overlapping Variant Data in Rust
Patterns for Modeling Overlapping Variant Data in Rust
When building complex systems in Rust, one of the fundamental challenges developers face is how to organize their data structures to maintain type safety, avoid code duplication, keep their API clean,...
An interesting article that lays out a problem and goes through a few different solutions, some of which I haven't thought about much before.
I'm working on a video game in Rust, and I'm running into this kind of modelling problem when it comes to keeping track of the game state. So far I've refactored something that resembles Approach 5 into something that looks more like Approach 3. As I get more confident about the final shape of the data, it (seemingly) becomes a better idea to represent it in a more structured way.