Trait bounds — inline constraints. where clauses — separate constraints.
Trait bounds:
1fn print<T: Display + Debug>(item: T) {2 println!("{}", item);3}
Where clause:
1fn print<T>(item: T)2where3 T: Display + Debug,4{5 println!("{}", item);6}
Complex constraints:
1fn process<T, U>(t: T, u: U)2where3 T: Display,4 U: Debug + Clone,5 <U as Iterator>::Item: Display,6{7 // ...8}
Key: Bounds for simple, where for complex.