Generic Bounds
In the Limitations section, we explained that operators are overloaded to work with references and non-references.
If you wish to write generic functions which use operators with mixed reference and non-reference, it might get tricky at first to specify the trait bounds. This page should serve as a cookbook to help you.
The for<'a>
syntax is something called Higher-Rank Trait Bounds, often shortened as HRTB
Example
Last updated