b'
Last time, we looked at generics and traits at a high level. This time, we dig deeper on traits, looking specifically at std::iter::Iterator
as an example of a powerful trait that can be composed across types, and then at how we might compose multiple traits on a single type.
We also talk about the syntax for traits, the use of marker traits, some of the things you can\\u2019t presently do with traits, and even just a smidge about the future of traits in Rust. All that in less than 20 minutes!
\\nYou\\u2019ll find today\\u2019s source example fairly interesting, I think: it\\u2019s just one type, but it uses almost every concept discussed on the show today!
\\nstd::iter
and std::iter::Iterator
Add
Drop
PartialEq
and Eq
PartialOrd
and Ord