- Mastering Rust
- Rahul Sharma Vesa Kaihlavirta
- 124字
- 2021-07-02 13:35:15
User-defined types
As the name says, user-defined types are types that are defined by you. These can be composed of several types. They may either be a wrapper over a primitive type or a composition of several user defined types. They come in three forms: structures, enumerations, and unions, or more commonly known as structs, enums, and unions. They allow you to easily express you data. The naming convention for user-defined types follows the CamelCase style. Structs and enums are more powerful than C's structs and enums, while unions in Rust are very close to C and are there mainly to interact with C code bases. We'll cover structs and enums in this section, while unions are covered in Chapter 7, Advanced Concepts.
推薦閱讀
- UI設(shè)計(jì)基礎(chǔ)培訓(xùn)教程
- Java范例大全
- OpenCV實(shí)例精解
- 新手學(xué)Visual C# 2008程序設(shè)計(jì)
- x86匯編語(yǔ)言:從實(shí)模式到保護(hù)模式(第2版)
- RabbitMQ Cookbook
- Node.js Design Patterns
- AIRIOT物聯(lián)網(wǎng)平臺(tái)開(kāi)發(fā)框架應(yīng)用與實(shí)戰(zhàn)
- 好好學(xué)Java:從零基礎(chǔ)到項(xiàng)目實(shí)戰(zhàn)
- Getting Started with React Native
- Machine Learning With Go
- Mastering Elixir
- Java 9 with JShell
- 計(jì)算機(jī)組裝與維護(hù)(第二版)
- Beginning C# 7 Hands-On:The Core Language