
عنوان:
The Rust Programming Language, 2nd Edition
نویسنده:
Steve Klabnik; Carol Nichols
انتشارات:
No Starch Press
تاریخ انتشار
2023
حجم:
3MB
معرفی کتاب:" کتاب زبان برنامهنویسی Rust، ویرایش دوم نوشتهی Steve Klabnik و Carol Nichols در ۵۶۰ صفحه منتشر شده و راهنمای جامع زبان Rust 2021 برای نوشتن نرمافزارهای سریع، مطمئن و مقیاسپذیر است. "
راهنمای رسمی زبان Rust 2021، یک زبان برنامهنویسی سیستمی متنباز که به شما کمک میکند نرمافزاری سریعتر و قابلاعتمادتر بنویسید. Rust کنترل دقیقی بر جزئیات سطح پایین فراهم میکند در حالیکه بهرهوری و راحتی استفاده از زبانهای سطح بالا را نیز ارائه میدهد.
Klabnik و Nichols، از اعضای پیشین تیم Rust، در این کتاب دانش خود را به اشتراک میگذارند تا بتوانید از تمام قابلیتهای Rust برای ساخت برنامههایی مقاوم و مقیاسپذیر استفاده کنید.
آنچه خواهید آموخت:
- مبانی ساخت تابع، تعریف متغیر و انتخاب نوع داده
- مفاهیم مالکیت و وامدهی، طول عمر، جنریکها، و Traits
- کار با اسمارت پوینترها، چندریسمانی و همزمانی بدون ترس (Fearless Concurrency)
- نحوه استفاده از Cargo برای مدیریت پروژهها، وابستگیها و مستندات
- بهترین روشها برای تست، مدیریت خطا، بازسازی کد و Pattern Matching
پروژههای عملی در کتاب:
- بازی حدس عدد (Guessing Game)
- ابزار خط فرمان (Command-line Tool)
- سرور چندریسمانی (Multithreaded Server)
این کتاب منبعی جامع و پروژهمحور برای تسلط کامل بر زبان Rust بهشمار میرود و برای تازهکارها تا توسعهدهندگان حرفهای مناسب است.
فهرست مطالب
- Title Page
- Copyright
- About the Authors
- Foreword
- Preface
- Acknowledgments
- Introduction
- Chapter 1: Getting Started
- Installation
- Hello, World!
- Hello, Cargo!
- Summary
- Chapter 2: Programming a Guessing Game
- Setting Up a New Project
- Processing a Guess
- Generating a Secret Number
- Comparing the Guess to the Secret Number
- Allowing Multiple Guesses with Looping
- Summary
- Chapter 3: Common Programming Concepts
- Variables and Mutability
- Data Types
- Functions
- Comments
- Control Flow
- Summary
- Chapter 4: Understanding Ownership
- What Is Ownership?
- References and Borrowing
- The Slice Type
- Summary
- Chapter 5: Using Structs to Structure Related Data
- Defining and Instantiating Structs
- An Example Program Using Structs
- Method Syntax
- Summary
- Chapter 6: Enums and Pattern Matching
- Defining an Enum
- The match Control Flow Construct
- Concise Control Flow with if let
- Summary
- Chapter 7: Managing Growing Projects with Packages, Crates, and Modules
- Packages and Crates
- Defining Modules to Control Scope and Privacy
- Paths for Referring to an Item in the Module Tree
- Bringing Paths into Scope with the use Keyword
- Separating Modules into Different Files
- Summary
- Chapter 8: Common Collections
- Storing Lists of Values with Vectors
- Storing UTF-8 Encoded Text with Strings
- Storing Keys with Associated Values in Hash Maps
- Summary
- Chapter 9: Error Handling
- Unrecoverable Errors with panic!
- Recoverable Errors with Result
- To panic! or Not to panic!
- Summary
- Chapter 10: Generic Types, Traits, and Lifetimes
- Removing Duplication by Extracting a Function
- Generic Data Types
- Traits: Defining Shared Behavior
- Validating References with Lifetimes
- Generic Type Parameters, Trait Bounds, and Lifetimes Together
- Summary
- Chapter 11: Writing Automated Tests
- How to Write Tests
- Controlling How Tests Are Run
- Test Organization
- Summary
- Chapter 12: An I/O Project: Building a Command Line Program
- Accepting Command Line Arguments
- Reading a File
- Refactoring to Improve Modularity and Error Handling
- Developing the Library’s Functionality with Test-Driven Development
- Working with Environment Variables
- Writing Error Messages to Standard Error Instead of Standard Output
- Summary
- Chapter 13: Functional Language Features: Iterators and Closures
- Closures: Anonymous Functions That Capture Their Environment
- Processing a Series of Items with Iterators
- Improving Our I/O Project
- Comparing Performance: Loops vs. Iterators
- Summary
- Chapter 14: More About Cargo and Crates.io
- Customizing Builds with Release Profiles
- Publishing a Crate to Crates.io
- Cargo Workspaces
- Installing Binaries with cargo install
- Extending Cargo with Custom Commands
- Summary
- Chapter 15: Smart Pointers
- Using Box<T> to Point to Data on the Heap
- Treating Smart Pointers Like Regular References with Deref
- Running Code on Cleanup with the Drop Trait
- Rc<T>, the Reference Counted Smart Pointer
- RefCell<T> and the Interior Mutability Pattern
- Reference Cycles Can Leak Memory
- Summary
- Chapter 16: Fearless Concurrency
- Using Threads to Run Code Simultaneously
- Using Message Passing to Transfer Data Between Threads
- Shared-State Concurrency
- Extensible Concurrency with the Send and Sync Traits
- Summary
- Chapter 17: Object-Oriented Programming Features
- Characteristics of Object-Oriented Languages
- Using Trait Objects That Allow for Values of Different Types
- Implementing an Object-Oriented Design Pattern
- Summary
- Chapter 18: Patterns and Matching
- All the Places Patterns Can Be Used
- Refutability: Whether a Pattern Might Fail to Match
- Pattern Syntax
- Summary
- Chapter 19: Advanced Features
- Unsafe Rust
- Advanced Traits
- Advanced Types
- Advanced Functions and Closures
- Macros
- Summary
- Chapter 20: Final Project: Building a Multithreaded Web Server
- Building a Single-Threaded Web Server
- Turning Our Single-Threaded Server into a Multithreaded Server
- Graceful Shutdown and Cleanup
- Summary
- Appendix A: Keywords
- Appendix B: Operators and Symbols
- Appendix C: Derivable Traits
- Appendix D: Useful Development Tools
- Appendix E: Editions
- Index
مشخصات
نام کتاب
The Rust Programming Language, 2nd Edition
نویسنده
Steve Klabnik; Carol Nichols
انتشارات
No Starch Press
تاریخ انتشار
2023
ISBN
9781593278519
چاپ
اول
تعداد صفحات
760
زبان
انگلیسی
فرمت
حجم
3MB
موضوع
programming-languages/rust