---
title: "Chapter 15: Generics"
description: "The 6 lessons of chapter 15: Generics, in teaching order."
url: "https://learnrust.net/chapter-15/"
last_updated: "2026-06-13"
---

# Chapter 15: Generics

- [15.1 The problem generics solve](https://learnrust.net/chapter-15/the-problem-generics-solve.md): Writing the same function for i32, then for char, then admitting defeat: the duplication that motivates generics, and what a type parameter is.
- [15.2 Generic functions](https://learnrust.net/chapter-15/generic-functions.md): Writing functions generic over a type with <T>, the kinds of generic code that compile without bounds, and the exact error you get when the body needs more.
- [15.3 Generic structs and enums](https://learnrust.net/chapter-15/generic-structs-and-enums.md): Structs and enums can take type parameters too; the reveal that Option and Vec were generic all along, plus type aliases and a glance at const generics.
- [15.4 Generic methods](https://learnrust.net/chapter-15/generic-methods.md): Implementing methods on generic types with impl<T> blocks, and writing methods that exist only for a specific instantiation like Point<f64>.
- [15.5 Monomorphization](https://learnrust.net/chapter-15/monomorphization.md): What the compiler actually produces from generic code: a specialized copy per type used, why this makes generics zero-cost at runtime, and the binary-size tradeoff.
- [15.x Chapter 15 summary and quiz](https://learnrust.net/chapter-15/chapter-15-summary-and-quiz.md): Review of the problem generics solve, generic functions, structs, enums, methods, and monomorphization, with a chapter quiz and an exercise.

## Sitemap

See the full [sitemap](https://learnrust.net/sitemap.md) for all pages.
