官术网_书友最值得收藏!

What this book covers

Chapter 1, Starting off with Rust, covers how to set up Rust toolchains on your computer and the fundamental constructs of the language. These range from writing tests and benchmarks to language constructs such as loops, if expressions, traits, and structs.

Chapter 2, Going Further with Advanced Rustanswers questions about more in-depth features of the language as well as patterns for creating meaningful programs. Topics include borrowing and ownership in complex scenarios, the Option type, pattern matching, generics, explicit lifetimes, and enums.

Chapter 3, Managing Projects with Cargouses the cargo tool to manage additional crates, extensions, projects, and tests. You will find recipes that empower you to work on larger projects and solve challenges faced in managing them.

Chapter 4Fearless Concurrencygoes into some best practices and recipes to build safe, fast programs. In addition to this, popular libraries such as Rayon are presented as we demonstrate that Rust is a great language for doing all kinds of concurrent tasks. 

Chapter 5, Handling Errors and Other Results, explains how Rust uses the Result type and panics to perform error handling, integrating most failure cases into a regular workflow that needs to be treated. This chapter shows applicable patterns and best practices around avoiding unexpected crashes and unnecessary complexity.

Chapter 6, Expressing Yourself with Macros, explains how Rust's unique macro system extends the functionality of programs before compilation—in a type safe way. These macros can be implemented for many possible custom scenarios, and many crates use this ability. This chapter is all about creating useful macros to make your life easier and your programs safer.

Chapter 7, Integrating Rust with Other Languages, uses and works with different binary units and languages from within Rust in order to port legacy software or benefit from better SDKs. This is realized mostly through the Foreign Function Interface (FFI), which enables quick and easy integration with other native binaries. On top of that, it is possible to publish to npm (the Node.js package repository) from Rust using WebAssembly. These and other things are discussed in this chapter.

Chapter 8, Safe Programming for the Webuses a state-of-the-art web framework to show the fundamentals of web programming – actix-web, which showcases an actor-based approach to handling requests, in productive use at Microsoft.

Chapter 9, Systems Programming Made Easy, explains how Rust is a great choice for running workloads on small devices with limited resources. In particular, the lack of a garbage collector and the resulting predictable runtime makes it a great fit for running sensor data collectors. Creating such a loop together with the required driver to read data is what we cover in this chapter.

Chapter 10, Getting Practical with Rust, covers practical considerations in Rust programming, such as parsing command-line arguments, working with neural networks (machine learning with PyTorch's C++ API), searching, regular expressions, web requests, and much more.

主站蜘蛛池模板: 科尔| 乌兰县| 横峰县| 勃利县| 上高县| 五河县| 额济纳旗| 星座| 东莞市| 星子县| 花莲市| 繁昌县| 景谷| 临邑县| 吐鲁番市| 临漳县| 威远县| 高阳县| 陈巴尔虎旗| 灵丘县| 桓台县| 西林县| 昌宁县| 嘉义县| 鸡泽县| 长白| 伽师县| 左权县| 塘沽区| 盘山县| 重庆市| 西乌| 乌鲁木齐县| 青海省| 南投县| 兴海县| 靖西县| 广德县| 阳山县| 邳州市| 龙南县|