Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Discussion 10: Traits

A review of traits: what they are, a worked example of defining and implementing one, trait bounds, and the traits you already use (Clone, Copy, PartialEq, Ord). The second half is an exercise, submitted on Gradescope.

Slides

The slides from discussion in PDF. If the viewer below doesn't load, use the download link.

Download the slides (PDF)

Exercise: Yes, chef!

The exercise is on the Rust Playground, with the instructions in the file. Submit your program and its output on Gradescope.