I’m pretty impressed with how
diesel uses types to model its domain, allowing for both expressiveness, type safety, and zero-cost abstractions. It’s probably one of the most trait-heavy crates that I’ve seen (one can argue the pros/cons of this aspect alone, but we can save that for another thread ) . It’s also a good example of leveraging Rust’s type system to model a domain safely, fairly concisely/ergonomically (from user’s standpoint), and not pay an abstraction cost at runtime.
Are there any other crates that people feel achieve these aspects well? I’m aware of a few other crates that do interesting things with the type system, such as
dimensioned, and perhaps a few similar ones that I’m forgetting.
Another way to frame my question is: what crate(s) would you show to, say, a coworker (that’s familiar with Rust’s “out of the box” features) that demonstrates a tastefully done assembly of Rust’s (more advanced) features to implement a perfomant and type safe system? The idea is the coworker likes the individual tools in Rust’s toolbox, but would like to see what a good craftsman has been able to build with them - what codebase(s) would you show them?