Programming Rust

Programming Rust pdf epub mobi txt 電子書 下載 2025

Jim Blandy
圖書標籤:
想要找書就要到 靜流書站
立刻按 ctrl+D收藏本頁
你會得到大驚喜!!
Preface
1. Why Rust?
Type Safety
2. A Tour of Rust
Downloading and Installing Rust
A Simple Function
Writing and Running Unit Tests
Handling Command-Line Arguments
A Simple Web Server
Concurrency
3. Basic Types
Machine Types
Tuples
Pointer Types
Arrays, Vectors, and Slices
String Types
Beyond the Basics
4. Ownership
Ownership
Moves
Copy Types: The Exception to Moves
Rc and Arc: Shared Ownership
5. References
References as Values
Reference Safety
Sharing Versus Mutation
Taking Arms Against a Sea of Objects
6. Expressions
An Expression Language
Blocks and Semicolons
Declarations
if and match
Loops
return Expressions
Why Rust Has loop
Function and Method Calls
Fields and Elements
Reference Operators
Arithmetic, Bitwise, Comparison, and Logical Operators
Assignment
Type Casts
Closures
Precedence and Associativity
Onward
7. Error Handling
Panic
Result
8. Crates and Modules
Crates
Modules
Turning a Program into a Library
The src/bin Directory
Attributes
Tests and Documentation
Specifying Dependencies
Publishing Crates to crates.io
Workspaces
More Nice Things
9. Structs
Named-Field Structs
Tuple-Like Structs
Unit-Like Structs
Struct Layout
Defining Methods with impl
Generic Structs
Structs with Lifetime Parameters
Deriving Common Traits for Struct Types
Interior Mutability
10. Enums and Patterns
Enums
Patterns
The Big Picture
11. Traits and Generics
Using Traits
Defining and Implementing Traits
Fully Qualified Method Calls
Traits That Define Relationships Between Types
Reverse-Engineering Bounds
Conclusion
12. Operator Overloading
Arithmetic and Bitwise Operators
Equality Tests
Ordered Comparisons
Index and IndexMut
Other Operators
13. Utility Traits
Drop
Sized
Clone
Copy
Deref and DerefMut
Default
AsRef and AsMut
Borrow and BorrowMut
From and Into
ToOwned
Borrow and ToOwned at Work: The Humble Cow
14. Closures
Capturing Variables
Function and Closure Types
Closure Performance
Closures and Safety
Callbacks
Using Closures Effectively
15. Iterators
The Iterator and IntoIterator Traits
Creating Iterators
Iterator Adapters
Consuming Iterators
Implementing Your Own Iterators
16. Collections
Overview
Vec<T>
VecDeque<T>
LinkedList<T>
BinaryHeap<T>
HashMap<K, V> and BTreeMap<K, V>
HashSet<T> and BTreeSet<T>
Hashing
Beyond the Standard Collections
17. Strings and Text
Some Unicode Background
Characters (char)
String and str
Formatting Values
Regular Expressions
Normalization
18. Input and Output
Readers and Writers
Files and Directories
Networking
19. Concurrency
Fork-Join Parallelism
Channels
Shared Mutable State
What Hacking Concurrent Code in Rust Is Like
20. Macros
Macro Basics
Built-In Macros
Debugging Macros
The json! Macro
Avoiding Syntax Errors During Matching
Beyond macro_rules!
21. Unsafe Code
Unsafe from What?
Unsafe Blocks
Unsafe Functions
Unsafe Block or Unsafe Function?
Undefined Behavior
Unsafe Traits
Raw Pointers
Foreign Functions: Calling C and C++ from Rust
Conclusion
Index
· · · · · · (收起)

具體描述

This practical book introduces systems programmers to Rust, the new and cutting-edge language that’s still in the experimental/lab stage. You’ll learn how Rust offers the rare and valuable combination of statically verified memory safety and low-level control—imagine C++, but without dangling pointers, null pointer dereferences, leaks, or buffer overruns.

Author Jim Blandy—the maintainer of GNU Emacs and GNU Guile—demonstrates how Rust has the potential to be the first usable programming language that brings the benefits of an expressive modern type system to systems programming. Rust’s rules for borrowing, mutability, ownership, and moves versus copies will be unfamiliar to most systems programmers, but they’re key to Rust’s unique advantages.

This book presents Rust’s rules clearly and economically; elaborates on their consequences; and shows you how to express the programs you want to write in terms that Rust can prove are free of a broad class of common errors.

用戶評價

評分

##很棒的書,主要麵嚮有經驗的程序員(特彆是 C++ 程序員),有些地方沒有官方的書講得詳細。其實最後一章 Unsafe Code 沒看完,以後再看。。。600頁不到的書為瞭公司培訓做瞭200多頁PPT,熬瞭不少夜,也是醉瞭。。。

評分

##比官方 doc 好

評分

##rust是個好語言,希望能早日取代c吧

評分

##很棒的書,主要麵嚮有經驗的程序員(特彆是 C++ 程序員),有些地方沒有官方的書講得詳細。其實最後一章 Unsafe Code 沒看完,以後再看。。。600頁不到的書為瞭公司培訓做瞭200多頁PPT,熬瞭不少夜,也是醉瞭。。。

評分

##寫的真一般,而且 trait 整個地方都變瞭...

評分

##讀到瞭對Rust更詳細的認識。

評分

##比官方好

評分

##細節很多,不如官網那本《the rust programming language》易讀。有很多跟 C++ 的對比。本書使用 rustc 1.17.0, 小部分內容已經變成 deprecated, 比如現在 trait object 要求明確使用 dyn 關鍵字

評分

##細節很多,不如官網那本《the rust programming language》易讀。有很多跟 C++ 的對比。本書使用 rustc 1.17.0, 小部分內容已經變成 deprecated, 比如現在 trait object 要求明確使用 dyn 關鍵字

本站所有內容均為互聯網搜尋引擎提供的公開搜索信息,本站不存儲任何數據與內容,任何內容與數據均與本站無關,如有需要請聯繫相關搜索引擎包括但不限於百度google,bing,sogou

© 2025 windowsfront.com All Rights Reserved. 靜流書站 版權所有