blob: 0caf2845d9308e763fe799253e7b8c87075ff77d [file] [log] [blame] [view] [edit]
When working with generics, the type parameters (e.g. `Ty`) may use traits
(e.g. `Tr`) as *bounds* (e.g. `Ty: Tr`, which reads as: `Ty` must implement the
`Tr` trait). Bounding has two effects:
* Generics instances (`let ty: Ty = (...)`) can now access the methods
(`ty.tr()`) of the traits specified in the bounds.
* The generic can only be specialized for type parameters that conform to the
bounds.
{bounds.play}