e003: No. more. nulls.

Published: Oct. 21, 2015, 5:10 p.m.

No More Nulls

\n

Subject: Enumerated (enum) types, pattern matching, and meaningful return types.

\nNotes\n

Today\u2019s episode discusses, in order:

\n
    \n
  • Enumerated types, with an eye to the difference between structs and enums, and to the differences between enums in C and in Rust.
  • \n
  • Pattern matching, with a focus on using them with enumerated types and some discussion about how they differ from switch blocks in C-like languages.
  • \n
  • Using the Option and Result enumerated types with pattern matching to provide meaningful returns from functions safely.
  • \n
\nOrder\n

There is a specific order to the examples below, and it is not the automatically-alphabetized order rendered by rustdoc. Instead, you should work through in the sequence they appear in the source:

\n
    \n
  1. RelatedishThings
  2. \n
  3. demonstrate_basic_enumeration
  4. \n
  5. demonstrate_match
  6. \n
  7. get_an_option
  8. \n
  9. demonstrate_option
  10. \n
  11. get_a_result
  12. \n
  13. demonstrate_result
  14. \n
\nLinks\n\nFollow/Support\n