Matching and Structures

On top of the primitive variables and generics, which we will come to in Chapter 9, Introducing Generics, Impl, and Traits, Rust is capable of storing groups of different types of variables in a struct construct that may be familiar to those who have developed in the C family of languages. There's also a related concept called enumerations for creating types with alternating options. If that is not enough, Rust can combine these in its powerful pattern-matching code.

In this chapter, we will cover the following topics:

  • Learning how to use and manipulate struct data types
  • Understanding tuples and the tuple struct hybrid
  • Creating and using enums
  • Understanding and applying the basics of patterns and matching
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset