Combining Rust's traits and enums

In this post we will cover a pattern that appeared multiple times in our codebase: wrapping trait implementations in an enum. Although this is not the reason that I use this approach, for those who interested it avoids the performance cost of dynamic dispatch.