Module show_notes::e023

source ·
Expand description

Traits Deep Dive, Part 1

  • Date: April 28, 2018
  • Subject: Defining and using your own traits, using other crates’ traits, and the orphan rule.
  • Audio

Show Notes

Traits—

Also of interest: specialization:

Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as well. You know who you are!)

Become a sponsor

Contact

Structs

  • e023: Traits Deep Dive, Part I

Enums

  • Breakfast is eatable, so Breakfast is Eatable!
  • Moar Breakfast is even better, so MoarBreakfast is also Eatable and Nomable!

Traits

  • A trait, to be implemented by types like Breakfast.
  • Just another way to eat things – exists to show conflicting trait methods.

Functions

  • Shows how you can use traits with your own and others’ types.