the-book:Rust编程语言代码

  • Z7_306628
    了解作者
  • 18.6MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-13 13:02
    上传日期
代码实现 1.入门 1.1。安装 1.2。你好,世界! 1.3。您好,货运! 2.编写猜谜游戏 2.1。设置一个新项目 2.2。处理猜测 2.3。生成一个秘密号码 2.4。比较猜测与秘密号码 2.5。允许使用循环进行多个猜测 3.通用编程概念 3.1。变量与可变性 3.2。资料类型 3.3。功能 3.4。评论 3.5。控制流 4.了解所有权 4.1。什么是所有权? 4.2。参考和借阅 4.3。切片类型 5.使用结构来构造相关数据 5.1。定义和实例化结构 5.2。使用结构的示例程序 5.3。方法语法 6.枚举和模式匹配 6.1。定义枚举 6.2。匹配控制流运算符 6.3。如果让简明的控制流 7.使用软件包,板条箱和模块管理不断增长的项目 7.1。包装和板条箱 7.2。定义模块以控制范围和隐私 7.3。引用模块树中项目的路径 7.4。使用关键字将路径带入范围 7.5。将模块
the-book-master.zip
内容介绍
## Code Implementation Of [The Rust Programming Language](https://doc.rust-lang.org/book/) #### 1. Getting Started - 1.1. Installation - 1.2. Hello, World! - 1.3. Hello, Cargo! #### 2. Programming a Guessing Game - 2.1. Setting Up a New Project - 2.2. Processing a Guess - 2.3. Generating a Secret Number - 2.4. Comparing the Guess to the Secret Number - 2.5. Allowing Multiple Guesses with Looping #### 3. Common Programming Concepts - 3.1. Variables and Mutability - 3.2. Data Types - 3.3. Functions - 3.4. Comments - 3.5. Control Flow #### 4. Understanding Ownership - 4.1. What is Ownership? - 4.2. References and Borrowing - 4.3. The Slice Type #### 5. Using Structs to Structure Related Data - 5.1. Defining and Instantiating Structs - 5.2. An Example Program Using Structs - 5.3. Method Syntax #### 6. Enums and Pattern Matching - 6.1. Defining an Enum - 6.2. The match Control Flow Operator - 6.3. Concise Control Flow with if let #### 7. Managing Growing Projects with Packages, Crates, and Modules - 7.1. Packages and Crates - 7.2. Defining Modules to Control Scope and Privacy - 7.3. Paths for Referring to an Item in the Module Tree - 7.4. Bringing Paths Into Scope with the use Keyword - 7.5. Separating Modules into Different Files #### 8. Common Collections - 8.1. Storing Lists of Values with Vectors - 8.2. Storing UTF-8 Encoded Text with Strings - 8.3. Storing Keys with Associated Values in Hash Maps #### 9. Error Handling - 9.1. Unrecoverable Errors with panic! - 9.2. Recoverable Errors with Result - 9.3. To panic! or Not To panic! #### 10. Generic Types, Traits, and Lifetimes - 10.1. Generic Data Types - 10.2. Traits: Defining Shared Behavior - 10.3. Validating References with Lifetimes #### 11. Writing Automated Tests - 11.1. How to Write Tests - 11.2. Controlling How Tests Are Run - 11.3. Test Organization #### 12. An I/O Project: Building a Command Line Program - 12.1. Accepting Command Line Arguments - 12.2. Reading a File - 12.3. Refactoring to Improve Modularity and Error Handling - 12.4. Developing the Library’s Functionality with Test Driven Development - 12.5. Working with Environment Variables - 12.6. Writing Error Messages to Standard Error Instead of Standard Output #### 13. Functional Language Features: Iterators and Closures - 13.1. Closures: Anonymous Functions that Can Capture Their Environment - 13.2. Processing a Series of Items with Iterators - 13.3. Improving Our I/O Project - 13.4. Comparing Performance: Loops vs. Iterators #### 14. More about Cargo and Crates.io - 14.1. Customizing Builds with Release Profiles - 14.2. Publishing a Crate to Crates.io - 14.3. Cargo Workspaces - 14.4. Installing Binaries from Crates.io with cargo install - 14.5. Extending Cargo with Custom Commands #### 15. Smart Pointers - 15.1. Using Box to Point to Data on the Heap - 15.2. Treating Smart Pointers Like Regular References with the Deref Trait - 15.3. Running Code on Cleanup with the Drop Trait - 15.4. Rc, the Reference Counted Smart Pointer - 15.5. RefCell and the Interior Mutability Pattern - 15.6. Reference Cycles Can Leak Memory #### 16. Fearless Concurrency - 16.1. Using Threads to Run Code Simultaneously - 16.2. Using Message Passing to Transfer Data Between Threads - 16.3. Shared-State Concurrency - 16.4. Extensible Concurrency with the Sync and Send Traits #### 17. Object Oriented Programming Features of Rust - 17.1. Characteristics of Object-Oriented Languages - 17.2. Using Trait Objects That Allow for Values of Different Types - 17.3. Implementing an Object-Oriented Design Pattern #### 18. Patterns and Matching - 18.1. All the Places Patterns Can Be Used - 18.2. Refutability: Whether a Pattern Might Fail to Match - 18.3. Pattern Syntax #### 19. Advanced Features - 19.1. Unsafe Rust - 19.2. Advanced Traits - 19.3. Advanced Types - 19.4. Advanced Functions and Closures - 19.5. Macros #### 20. Final Project: Building a Multithreaded Web Server - 20.1. Building a Single-Threaded Web Server - 20.2. Turning Our Single-Threaded Server into a Multithreaded Server - 20.3. Graceful Shutdown and Cleanup
评论
    相关推荐