Skip to content

Glossary: Software Design Patterns in Rust

Generic

Also written: generics, trait bound

Code written for any type that meets a trait bound, like `R: Repo`. The compiler builds a separate copy for each type used, which is fast but fixed at compile time.

Where the book teaches it

Related terms

Static dispatchDynamic dispatch