Traits and Generics

Traits and generics form the core of advanced Rust. They are similar to C++ templates (and concepts, if you are lucky enough to have a compiler that supports them).

Traits are basically an interface---a promise to expose an API.

Generics are structures and functions that be templated to adapt to other types that implement traits.