ENGLISH

Rust for Rustaceans: Idiomatic Programming for Experienced Developers

Book information

Publisher
No Starch Press
Year
2021
ISBN
1718501854, 9781718501850
Language
english
Format
PDF
Filesize
12 MB (12423910 bytes)
Pages
280\214
Time added
2021-09-27 14:48:23

Description

Master professional-level coding in Rust. For developers who’ve mastered the basics, this book is the next step on your way to professional-level programming in Rust. It covers everything you need to build and maintain larger code bases, write powerful and flexible applications and libraries, and confidently expand the scope and complexity of your projects.   Author Jon Gjengset takes you deep into the Rust programming language, dissecting core topics like ownership, traits, concurrency, and unsafe code. You’ll explore key concepts like type layout and trait coherence, delve into the inner workings of concurrent programming and asynchrony with async/await, and take a tour of the world of no_std programming. Gjengset also provides expert guidance on API design, testing strategies, and error handling, and will help develop your understanding of foreign function interfaces, object safety, procedural macros, and much more.   You'll Learn:   •  How to design reliable, idiomatic, and ergonomic Rust programs based on best principles   •  Effective use of declarative and procedural macros, and the difference between them   •  How asynchrony works in Rust – all the way from the Pin and Waker types used in manual implementations of Futures, to how async/await saves you from thinking about most of those words   •  What it means for code to be unsafe, and best practices for writing and interacting with unsafe functions and traits   •  How to organize and configure more complex Rust projects so that they integrate nicely with the rest of the ecosystem   •  How to write Rust code that can interoperate with non-Rust libraries and systems, or run in constrained and embedded environments   Brimming with practical, pragmatic insights that you can immediately apply, Rust for Rustaceans helps you do more with Rust, while also teaching you its underlying mechanisms. 2: FOUNDATIONS Talking About Memory Ownership Borrowing and Lifetimes Summary 3: TYPES Types in Memory Traits and Trait Bounds Existential Types Summary 4: DESIGNING INTERFACES Unsurprising Flexible Obvious Constrained Summary 5: ERROR HANDLING Representing Errors Propagating Errors Summary 6: PROJECT STRUCTURE Features Workspaces Project Configuration Conditional Compilation Versioning Summary 7: TESTING Rust Testing Mechanisms Additional Testing Tools Summary 8: MACROS Declarative Macros Procedural Macros Summary 9: ASYNCHRONOUS PROGRAMMING What’s the Deal with Asynchrony? Ergonomic Futures Going to Sleep Tying It All Together with spawn Summary 10: UNSAFE CODE The unsafe Keyword Great Power Great Responsibility Coping with Fear Summary 11: CONCURRENCY (AND PARALLELISM) The Trouble with Concurrency Concurrency Patterns Asynchrony and Parallelism Lower-Level Concurrency Sane Concurrency Summary 12: FOREIGN FUNCTION INTERFACES Crossing Boundaries with extern Types Across Language Boundaries bindgen and Build Scripts Summary

Similar books