- Rust Essentials(Second Edition)
- Ivo Balbaert
- 550字
- 2021-07-02 15:30:33
What this book covers
Chapter 1, Starting with Rust, discusses the main reasons that led to the development of Rust. We compare Rust with other languages and indicate the areas for which it is most appropriate. Then, we guide you through installing all the necessary components for a Rust development environment. In particular, you will learn how to work with Cargo, Rust’s package manager.
Chapter 2, Using Variables and Types, looks at the basic structure of a Rust program. We discuss the primitive types, how to declare variables and whether they have to be typed, and the scope of variables. Immutability, one of the key cornerstones of Rust’s safety strategy is also illustrated. Then, we look at basic operations, how to do formatted printing, and the important difference between expressions and statements.
Chapter 3, Using Functions and Control Structures, shows how to define functions, and the different ways to influence program execution flow in Rust. We also take a look at attributes and how to do testing in Rust.
Chapter 4, Structuring Data and Matching Patterns, discusses the basic data types for programming, such as strings, vectors, slices, tuples, and enums. You will learn how to get input from the console and how to work with program arguments. Then we show you the powerful pattern matching that is possible in Rust and how values are extracted by destructuring patterns.
Chapter 5, Higher Order Functions and Error-Handling, explores the functional features of Rust. We see how data structures and functions can be defined in a generic way. Furthermore, you will learn how to work with Rust’s unique error-handling mechanism.
Chapter 6, Using Traits and OOP in Rust, explores the object-oriented features of Rust. We see how traits can be used to define behavior and to simulate inheritance in data structures. We also explore some common OOP patterns implemented in Rust, such as the visitor and the builder pattern.
Chapter 7, Ensuring Memory Safety and Pointers, exposes the borrow checker, Rust’s mechanism to ensure that only memory safe operations can occur during program execution. Different kinds of pointers are discussed in this chapter.
Chapter 8, Organizing Code and Macros, discusses the bigger code-organizing structures in Rust, such as modules and crates. It also touches upon how to build macros in order to generate code, thus saving time and effort.
Chapter 9, Concurrency – Coding for Multicore Execution, delves into Rust’s concurrency model based on threads and channels. We also discuss a safe strategy for working with shared mutable data.
Chapter 10, Programming at the Boundaries, looks at how Rust behaves in situations where we have to leave the safety boundaries, such as when interfacing with C or using raw pointers, and how Rust minimizes potential dangers when doing so.
Chapter 11, Exploring the Standard Library, gives us an overview of what is contained in Rust’s Standard Library with an emphasis on collections and the built-in macros. We also discuss how to let Rust work without standard library, for example, in very resource-constrained environments.
Chapter 12, The Ecosystem of Crates, covers how to work with crates built by other developers. We look at crates to work with files and databases, do web development, and develop graphics applications and games.
- 垃圾回收的算法與實(shí)現(xiàn)
- Cassandra Design Patterns(Second Edition)
- Learn Programming in Python with Cody Jackson
- PHP+MySQL網(wǎng)站開發(fā)項(xiàng)目式教程
- C語言程序設(shè)計(jì)同步訓(xùn)練與上機(jī)指導(dǎo)(第三版)
- 精通Python自動(dòng)化編程
- Clean Code in C#
- Zabbix Performance Tuning
- OpenCV 3計(jì)算機(jī)視覺:Python語言實(shí)現(xiàn)(原書第2版)
- Learning VMware vSphere
- Visual Basic程序設(shè)計(jì)實(shí)驗(yàn)指導(dǎo)及考試指南
- Data Manipulation with R(Second Edition)
- Go Systems Programming
- Effective C++:改善程序與設(shè)計(jì)的55個(gè)具體做法(第三版)中文版(雙色)
- PHP高性能開發(fā):基礎(chǔ)、框架與項(xiàng)目實(shí)戰(zhàn)