13
Structures
Structures are custom types that consist of fields and functions. As a developer-defined type, structs are often referred to as a user-defined type (UDT). With structures, you can create made-to-order types that are tailored to the specific requirements of your application. In Rust, structures are represented by struct types.
As a structure, a struct can provide context to data. It can be the difference between random data and useful information. Applications that consist exclusively of primitives are harder to maintain and refactor, when necessary. A struct can aggregate data into a cohesive unit that is easier to manage than the individual components. As an example, RGB is a standard for representing colors that are comprised ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access