Pattern Matching

  • Patterns are a special syntax in Rust for matching against the structure of types, both complex and simple

  • Rust provides pattern matching via the match keyword, which can be used like a C switch.