Glossary coding Term Page
Trait
A Rust interface-like abstraction that describes shared behavior
Core Idea
A trait declares the shared methods a type must provide. It lets different concrete types participate in the same generic logic by focusing on behavior instead of concrete structure.
Why It Matters Here
Mathbong uses traits as the hub for generic functions, impl Trait, and standard abstractions such as Display and Iterator. They are the moment Rust shifts from "what type is this?" to "what behavior does this promise?"