Module show_notes::e021

source ·
Expand description

Keeping your types under cover

  • Date: July 17, 2017
  • Subject: Using type aliases and creating custom type wrappers for more expressive and safer code.
  • Audio

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

Enums

  • A “newtype” built by wrapping a String in a single-variant enum.

Functions

  • A simple function showing you can use a String where an Email is required.
  • A function which takes a string, to use with Deref and EmailStruct.

Type Aliases

  • A type alias for a string that is appropriate to use as an email address.