Trait definitions
A trait lists method signatures:
trait Shape {
fn area(&self) -> f64;
}
Types implement the trait with an impl block. A type must implement every method to satisfy the trait.
Multiple trait bounds
Combine bounds:
fn describe<T: Greet + std::fmt::Display>(t: &T) {
println!("{} says {}", t, t.greet());
}
+ chains multiple bounds. The type must implement all of them. Display lets values be formatted with {}.