
Generics
Generics in Rust and How Monomorphization Makes Them Fast
Generic Rust code is compiled once per concrete type, which is why it is as fast as hand written code and why binaries grow. See what that looks like.
6 min read
Tag
2 posts

Generic Rust code is compiled once per concrete type, which is why it is as fast as hand written code and why binaries grow. See what that looks like.

A guide to choosing between generics, impl Trait, trait objects and enums in Rust, with one example solved four ways and the costs of each.