Solving Rust Data Modeling with View-Types: A Macro-Driven Approach

In the previous article, Patterns for Modeling Overlapping Variant Data in Rust, six different approaches to modeling overlapping data structures were explored, each with their own trade-offs between type safety, code duplication, and API flexibility. Today, I want to introduce a solution that addresses many of these challenges: the view-types macro.