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
§Links and Notes
§Sponsors
- Anthony Deschamps
- Anthony Scotti
- Aleksey Pirogov
- Andreas Fischer
- Andrew Thompson
- Austin LeSure
- Behnam Esfahbod
- Benjamin Wasty
- Brent Vatne
- Charlie Egan
- Chris Jones
- Chris Palmer
- Dan Abrams
- Daniel Collin
- David W. Allen
- Derek Morr
- Eugene Bulkin
- Henri Sivonen
- Jakub “Limeth” Hlusička
- James Cooper
- Jonathan Turner
- Jordan Henderson
- Jupp Müller
- Justin Ossevoort
- Karl Hobley
- Keith Gray
- Kilian Rault
- Luca Schmid
- Matt Rudder
- Matthew Piziak
- Max Jacobson
- Messense Lv
- Micael Bergeron
- Ovidiu Curcan
- Pascal Hertleif
- Patrick O’Doherty
- Peter Tillemans
- Philipp Keller
- Ralph Giles (“rillian”)
- Randy MacLeod
- Raph Levien
- reddraggone9
- Sebastián Ramírez Magrí
- Steven Murawski
- Stuart Hinson
- Tim Brooks
- Tom Prince
- Ty Overby
- Tyler Harper
- Vesa Kaihlavirta
- Warren Harper
- William Roe
- Zaki
(Thanks to the couple people donating who opted out of the reward tier, as well. You know who you are!)
§Become a sponsor
§Contact
- New Rustacean:
- Twitter: @newrustacean
- Email: hello@newrustacean.com
- Chris Krycho
- GitHub: chriskrycho
- Twitter: @chriskrycho
Structs§
- A “newtype” built by wrapping a
String
in a tuple struct. - A simple thing to demonstrate destructuring
Enums§
- A “newtype” built by wrapping a
String
in a single-variant enum.
Functions§
- A simple function showing you can use a
String
where anEmail
is required. - A function which takes a string, to use with
Deref
andEmailStruct
.
Type Aliases§
- A type alias for a string that is appropriate to use as an email address.