Programming with Rust
معرفی کتاب «Programming with Rust» نوشتهٔ Ferdia Lennon و Donis Marshall، منتشرشده توسط نشر Addison-Wesley Professional در سال 2024. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است.
Rust's exciting innovations have made it the most loved programming language in Stack Overflow's influential survey for five straight years--but its steep learning curve has made many other developers reluctant to dive in. Now, with a growing commitment to Rust from many of the world's leading development organizations, it's the perfect time to start--especially now that there's an up-to-date, accessible, example-rich book to guide you. Long-time enterprise developer Donis Marshall has made Rust easier to understand than ever, with a guide expertly organized into short, bite-sized chapters and supported with focused video tutorials that bring you up-to-speed fast. Writing for developers at all levels, Marshall starts with the absolute basics, and thoroughly demystifies the Rust technical advances that make it so attractive for next-generation development. Everything's here, from types and assignments to ownership, lifetimes, traits, and crates. Marshall even offers indispensable expert advice for unit testing, handling unsafe code, interoperating with legacy code bases, and using Rust's increasingly robust tools. More than just a new language, Rust represents a philosophical shift in how you code. With Programming in Rust, you'll master the techniques and the mindset, make Rust a key tool in your arsenal, and access one of the industry's fastest-growing areas of opportunity. Cover Half Title Title Page Copyright Page Contents 1 Introduction to Rust Introduction Functional Programming Expression Oriented Pattern-Oriented Features Safeness Ownership Lifetimes Fearless Concurrency Zero-Cost Abstraction Rust Terminology Tools A Note About Security Summary 2 Getting Started Preliminaries Rust and Windows Installing Rust Advanced Rustup “Hello, World” Compile and Run Cargo Library Comments Published Crates Main Function Command-Line Arguments Summary 3 Variables Terminology Variables Primitives Integer Types Overflow Notations Floating Point Types Floating Point Constants Infinity NaN Numeric Ranges Casting Boolean Types Char Pointers References Operators Summary 4 Strings Str String Length Extending a String Capacity Accessing a String Value String Characters Deref Coercion Formatted String Helpful Functions Summary 5 Console Print Positional Arguments Variable Arguments Named Arguments Padding, Alignment, and Precision Base Developer Facing Write! Macro Display Trait Debug Trait Format! Macro Console Read and Write Summary 6 Control Flow The if Expression The while Expression The break and continue Keywords The for Expression The loop Expression The loop break Expression The Iterator Trait The loop Label Summary 7 Collections Arrays Multidimensional Arrays Accessing Array Values Slices Comparing Arrays Iteration Coercion Vectors Multidimensional Access Iteration Resizing Capacity HashMap Creating a HashMap Accessing the HashMap Updating an Entry Iteration Summary 8 Ownership Stack and Heap Memory Shallow versus Deep Copy Car Analogy Move Semantics Borrow Copy Semantics Clone Trait Copy Trait Clone Trait Summary 9 Lifetimes Introduction to Lifetimes Function Headers and Lifetimes Lifetime Annotation Lifetime Elision Complex Lifetimes Sharing a Lifetime Static Lifetimes Structs and Lifetimes Methods and Lifetimes Subtyping Lifetimes Anonymous Lifetimes Generics and Lifetimes Summary 10 References Declaration Borrowing Dereferencing Comparing References Reference Notation Reference to Reference Mutability Limits to Multiple Borrowers Summary 11 Functions Function Definition Parameters Function Return Const Functions Nested Functions Function Pointers Function Aliases Summary 12 Error Handling Handling Error Handling The Result Enum The Option Enum Panics Panic! Macro Handling Panics Unwrapping Match Pattern for Result and Option Map Rich Errors Custom Errors Summary 13 Structures Alternate Initialization Move Semantics Mutability Methods Self Associated Functions Impl Blocks Operator Overloading Unary Operator Overloading Binary Operator Overloading Tuple Struct Unit-Like Struct Summary 14 Generics Generic Functions Bounds The where Clause Structs Associated Functions Enums Generic Traits Explicit Specialization Summary Summary 15 Patterns Let Statement Wildcards Complex Patterns Ownership Irrefutable Ranges Multiple Patterns Control Flow Structs Functions Match Expressions Match Guards Summary 16 Closures “Hello, World” Closure Syntax Closed Over Closures as Function Arguments Closures as Function Return Values Implementation of Closures The Fn Trait The FnMut Trait The FnOnce Trait The move Keyword The Impl Keyword Matrix Example Summary 17 Traits Trait Definition Default Functions Marker Trait Associated Functions Associated Types Extension Methods Fully Qualified Syntax Supertraits Static Dispatch Dynamic Dispatch Enums and Traits Summary 18 Threads 1 Synchronous Function Calls Threads The Thread Type Processor Time Builder Communicating Sequential Process Asynchronous Channel Synchronous Channel Rendezvous Channel The try Methods Store Example Summary 19 Threads 2 Mutex Nonscoped Mutex Mutex Poisoning Reader-Writer Lock Condition Variables Atomic Operations Store and Load Fetch and Modify Compare and Exchange Summary 20 Memory Stacks Static Values The Heap Interior Mutability RefCell OnceCell Summary 21 Macros Tokens Declarative Macros Repetition Multiple Macro Matchers Procedural Macros Derive Macros Attribute Macros Function-Like Macros Summary 22 Interoperability Foreign Function Interface Basic Example Libc Crate Structs Bindgen C Calling Rust Functions Cbindgen Summary 23 Modules Module Items Module Files The path Attribute Functions and Modules The crate, super, and self Keywords Legacy Model Summary Index A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
دانلود کتاب Programming with Rust