Rust Documentation: Chapter 5
In the previous chapter, we saw we can use slices as references to a contiguous sequence of elements in a collection instead of the whole collection. In this chapter, we will deviate from Ownership rules and see how we can use structs to create custom data types. Structs In Rust, and in object-oriented programming languages, a Struct or structure is a custom data type that lets you hold multiple values in relation to it....