The Rust Programming Language (Covers Rust 2018)No Starch Press, 12 août 2019 - 560 pages The official book on the Rust programming language, written by the Rust development team at the Mozilla Foundation, fully updated for Rust 2018. The Rust Programming Language is the official book on Rust: an open source systems programming language that helps you write faster, more reliable software. Rust offers control over low-level details (such as memory usage) in combination with high-level ergonomics, eliminating the hassle traditionally associated with low-level languages. The authors of The Rust Programming Language, members of the Rust Core Team, share their knowledge and experience to show you how to take full advantage of Rust's features--from installation to creating robust and scalable programs. You'll begin with basics like creating functions, choosing data types, and binding variables and then move on to more advanced concepts, such as: You'll find plenty of code examples throughout the book, as well as three chapters dedicated to building complete projects to test your learning: a number guessing game, a Rust implementation of a command line tool, and a multithreaded server. New to this edition: An extended section on Rust macros, an expanded chapter on modules, and appendixes on Rust development tools and editions. |
Table des matières
Processing a Series of Items with Iterators | 276 |
Improving Our IO Project | 283 |
Summary | 289 |
More About Cargo and Crates io | 291 |
Cargo Workspaces | 303 |
Smart Pointers | 311 |
Treating Smart Pointers Like Regular References with the Deref Trait | 317 |
Running Code on Cleanup with the Drop Trait | 323 |
| 49 | |
| 57 | |
| 59 | |
| 70 | |
Using Structs to Structure Related Data | 83 |
Method Syntax | 92 |
Enums and Pattern Matching | 97 |
Defining an Enum | 98 |
The match Control Flow Operator | 104 |
Summary | 110 |
Managing Growing Projects with Packages Crates and Modules | 111 |
Bringing Paths into Scope with the use Keyword | 121 |
Summary | 128 |
Common Collections | 131 |
Storing UTF8 Encoded Text with Strings | 137 |
Error Handling | 151 |
To panic or Not to panic | 164 |
Generic Types Traits and Lifetimes | 171 |
Defining Shared Behavior | 182 |
Validating References with Lifetimes | 192 |
Generic Type Parameters Trait Bounds and Lifetimes Together | 205 |
Writing Automated Tests | 207 |
Test Organization | 227 |
An IO Project Building a Command Line Program | 233 |
Developing the Librarys Functionality with TestDriven Development | 250 |
Writing Error Messages to Standard Error Instead of Standard Output | 260 |
Functional Language Features Iterators and Closures | 263 |
RefCellT and the Interior Mutability Pattern | 330 |
Reference Cycles Can Leak Memory | 339 |
Summary | 346 |
Fearless Concurrency | 347 |
Using Message Passing to Transfer Data Between Threads | 355 |
SharedState Concurrency | 361 |
Summary | 370 |
ObjectOriented Programming Features of Rust | 371 |
Patterns and Matching | 395 |
Whether a Pattern Might Fail to Match | 401 |
Summary | 416 |
Advanced Features | 417 |
Advanced Traits | 427 |
Advanced Types | 437 |
Advanced Functions and Closures | 443 |
Final Project Building a Multithreaded Web Server | 457 |
Turning Our SingleThreaded Server into a Multithreaded Server | 468 |
Graceful Shutdown and Cleanup | 487 |
Summary | 493 |
Keywords | 495 |
Operators and Symbols | 499 |
Derivable Traits | 507 |
Useful Development Tools | 511 |
Fix Your Code with rustfix | 512 |
Editions | 515 |
Index | 517 |
Autres éditions - Tout afficher
Expressions et termes fréquents
&mut &str add_to_waitlist annotations arguments assert_eq behavior binary borrow Box<T cargo run cargo test Cargo.toml Chapter closure code in Listing compile Config crate create default defined definition Deref dereference operator enum environment variable error message example Finished dev unoptimized fn main function guess handle hash map Hello immutable impl instance iterator keyword languages let mut look loop macro match expression method mock object module multiple mutable reference mutex newtype operator Option<T output ownership panic pattern println programming languages pub fn Rc<T Rectangle RefCell<T reference count result return value run cargo runtime Rust code Rust's scope shown in Listing smart pointers snip spawned thread specify src/lib.rs src/main.rs standard library static variable string literals string slice struct syntax target(s thread::spawn ThreadPool trait bounds trait object tuple type parameters unsafe valid variable variant vector write

