Where Clause

  • A bound can also be expressed using a where clause immediately before the opening {, rather than at the type's first mention

  • Additionally, where clauses can apply bounds to arbitrary types, rather than just to type parameters

impl <A: TraitB + TraitC, D: TraitE + TraitF> MyTrait<A, D> for YourType {}

// Expressing bounds with a `where` clause
impl <A, D> MyTrait<A, D> for YourType where
    A: TraitB + TraitC,
    D: TraitE + TraitF {
}