good explanation of Generic Types, Traits, and Lifetimes
A trait tells the Rust compiler about functionality a particular type has and can share with other types. We can use traits to define shared behaviour in an abstract way. We can use trait bounds to specify that a generic can be any type that has a certain behaviour.