Summary

In this chapter, we increased our capabilities for working with composite data in Rust, from strings, arrays and vectors, and slices of both, to tuples, structs, and enums. We also discovered that pattern matching, combined with destructuring and guards, is a very powerful tool for writing clear and elegant code. We learned how to process input from the console with error-handling, and how to use program arguments.

In the following chapter, we will see that functions are much more powerful than we saw until now. Furthermore, we will discover that structs can have methods by implementing traits, almost like classes and interfaces in other languages.