How can you have an alpha without generics?
But yes, their primary usage is to require that type parameters exhibit a certain set of properties.
enum Option<T> { Some{value: T}, None } // Old-style generics; monomorphized
// with S as an "input" type of MyTrait
fn foo<S, T: MyTrait<S>>(elem: T) { ... }
// Where-clause-style generics; monomorphized,
// with S as an "output" (associated) type of MyTrait
fn foo<S, T>(elem: T)
where T: MyTrait<Thing = S> { ... }
// Trait objects; dynamic dispatch
fn foo(elem: Box<MyTrait>) { ... } fn foo<S, T: MyTrait<S>>(elem: T) { ... }
fn foo<S, T>(elem: T) where T: MyTrait<S> { ... }
and fn foo<S, T: MyTrait<Thing = S>>(elem: T) { ... }
fn foo<S, T>(elem: T) where T: MyTrait<Thing = S> { ... }