Programming Rust. Fast, Safe Systems Development. 3rd Edition - Helion

ISBN: 9781098176198
stron: 730, Format: ebook
Data wydania: 2026-10-15
Księgarnia: Helion
Cena książki: 237,15 zł (poprzednio: 275,76 zł)
Oszczędzasz: 14% (-38,61 zł)
Rust combines low-level control with memory safety, making it an ideal choice for systems programming. This practical guide is for experienced programmers looking to write fast, reliable code while avoiding common pitfalls like data races and buffer overflows. Authors Jim Blandy, Jason Orendorff, and Leonora Tindall explain Rust's unique approach to ownership, borrowing, and concurrency, helping you build safe, high-performance applications.
Fully updated for Rust's 2024 edition, this book introduces the latest language advancements while covering essential topics like generics, async programming, and C interoperability. Whether you're working on low-latency systems, embedded software, or multithreaded applications, this edition equips you with the knowledge to write efficient, production-ready Rust code.
- Learn Rust's core principles, including ownership, borrowing, and lifetimes
- Write safe, efficient concurrent code without data races
- Use powerful features like macros, closures, and async programming
- Integrate Rust with C and C++ through FFI and unsafe code
- Apply best practices to write performance-critical, memory-safe applications
Osoby które kupowały "Programming Rust. Fast, Safe Systems Development. 3rd Edition", wybierały także:
- Jak zhakowa 125,00 zł, (10,00 zł -92%)
- Windows Media Center. Domowe centrum rozrywki 66,67 zł, (8,00 zł -88%)
- Biologika Sukcesji Pokoleniowej. Sezon 3. Konflikty na terytorium 124,37 zł, (19,90 zł -84%)
- Ruby on Rails. Ćwiczenia 18,75 zł, (3,00 zł -84%)
- Wszyscy m 29,41 zł, (5,00 zł -83%)
Spis treści
Programming Rust. Fast, Safe Systems Development. 3rd Edition eBook -- spis treści
- Preface
- Who Should Read This Book
- Why We Wrote This Book
- Navigating This Book
- Conventions Used in This Book
- Using Code Examples
- OReilly Online Learning
- How to Contact Us
- Acknowledgments
- 1. Systems Programmers Can Have Nice Things
- Rust Shoulders the Load for You
- Parallel Programming Is Tamed
- And Yet Rust Is Still Fast
- Rust Makes Collaboration Easier
- 2. A Tour of Rust
- rustup and Cargo
- Rust Functions
- Writing and Running Unit Tests
- Handling Command-Line Arguments
- Serving Pages to the Web
- Concurrency
- What the Mandelbrot Set Actually Is
- Parsing Pair Command-Line Arguments
- Mapping from Pixels to Complex Numbers
- Plotting the Set
- Writing Image Files
- A Concurrent Mandelbrot Program
- Safety Is Invisible
- 3. Fundamental Types
- Numeric Types
- Integer Types
- Handling Integer Overflow
- Floating-Point Types
- The bool Type
- Tuples
- Pointer Types
- Arrays, Vectors, and Slices
- Arrays
- Vectors
- Slices
- String and Character Types
- String and Character Literals
- Characters and Strings in Memory
- String
- Using Strings
- Other String-Like Types
- Type Aliases
- Beyond the Basics
- Numeric Types
- 4. Ownership and Moves
- Ownership
- Moves
- More Operations That Move
- Moves and Control Flow
- Moves and Indexed Content
- Copy Types: The Exception to Moves
- Rc and Arc: Shared Ownership
- 5. References
- Reference Basics
- Working with References
- Implicit and Explicit References
- Assigning References
- References to References
- Comparing References
- References Are Never Null
- Borrowing References to Arbitrary Expressions
- Fat Pointers
- Reference Safety
- Borrowing a Local Variable
- Receiving References as Function Arguments
- Passing References to Functions
- Returning References
- Structs Containing References
- Distinct Lifetime Parameters
- Omitting Lifetime Parameters
- Sharing Versus Mutation
- Taking Arms Against a Sea of Objects
- 6. Expressions
- An Expression Language
- Blocks
- Declarations
- if and match
- if let
- let else
- Loops
- break and continue Expressions
- Labeled Blocks
- return Expressions
- Why Rust Has loop
- const and unsafe Blocks
- Operators
- Function and Method Calls
- Fields and Elements
- Reference Operators
- Arithmetic, Bitwise, Comparison, and Logical Operators
- Assignment
- Type Casts
- Closures
- Onward
- 7. Error Handling
- Panic
- Unwinding
- Aborting
- The Panic Hook
- Other Panic Macros
- Result
- Catching Errors
- Printing Errors
- Propagating Errors
- Result Methods
- Result Type Aliases
- Working with Multiple Error Types
- A Universal Error Type: anyhow
- Defining Custom Error Types
- Dealing with Errors That Cant Happen
- Ignoring Errors
- Handling Errors in main()
- Why Results?
- Panic
- 8. Crates and Modules
- Crates
- Editions
- Rust Versions
- Build Profiles
- Modules
- Nested Modules
- Modules in Separate Files
- Paths and Imports
- The Standard Prelude
- Making use Declarations pub
- Making Struct Fields pub
- Constants and Statics
- Turning a Program into a Library
- The src/bin Directory
- Attributes
- Conditional Compilation
- The Build Environment
- Including Files
- Tests and Documentation
- Integration Tests
- Documentation
- Doc-Tests
- Specifying Dependencies
- Versions
- Cargo.lock
- Build Scripts
- Publishing Crates to crates.io
- Workspaces
- More Nice Things
- Crates
- 9. Structs
- Defining Structs
- Other Kinds of Structs
- Tuple Structs
- Unit-Like Structs
- Struct Layout
- Defining Methods with impl
- Passing Self as a Box, Rc, or Arc
- Nonmethod Associated Functions
- Associated Constants
- Generic Structs
- Generic Structs with Lifetime Parameters
- Generic Structs with Constant Parameters
- Deriving Common Traits for Struct Types
- Interior Mutability
- 10. Enums and Patterns
- Enums
- Enums with Data
- Enums in Memory
- Rich Data Structures Using Enums
- Generic Enums
- Patterns
- Literals, Variables, and Wildcards in Patterns
- Tuple and Struct Patterns
- Matching References
- Reference Patterns
- Array and Slice Patterns
- Match Guards
- Matching Multiple Possibilities
- Binding with @ Patterns
- Where Patterns Are Allowed
- Populating a Binary Tree
- Public Enums and Compatibility
- The Big Picture
- Enums
- 11. Traits and Generics
- Using Traits
- Using dyn
- dyn reference layout
- Generic Functions and Type Parameters
- Which to Use
- Using dyn
- Defining and Implementing Traits
- Default Methods
- Traits and Other Peoples Types
- Self in Traits
- Subtraits
- Associated Functions
- Associated Constants
- Fully Qualified Method Calls
- Traits That Define Relationships Between Types
- Associated Types (or How Iterators Work)
- Generic Traits (or How Operator Overloading Works)
- impl Trait
- Lifetime Bounds
- use Bounds
- Reverse-Engineering Bounds
- Traits as a Foundation
- Using Traits
- 12. Operator Overloading
- Arithmetic and Bitwise Operators
- Unary Operators
- Binary Operators
- Compound Assignment Operators
- Equivalence Comparisons
- The Eq Trait (Or: Equality vs. NaN)
- Ordered Comparisons
- Index and IndexMut
- Other Operators
- Arithmetic and Bitwise Operators
- 13. Utility Traits
- Drop
- Sized
- Clone
- Copy
- Deref and DerefMut
- Default
- AsRef and AsMut
- Borrow and BorrowMut
- From and Into
- TryFrom and TryInto
- ToOwned
- Borrow and ToOwned at Work: The Humble Cow
- 14. Closures
- Capturing Variables
- Closures That Borrow
- Closures That Steal
- Function and Closure Types
- Closure Performance
- Closures and Safety
- Closures That Kill
- FnOnce
- FnMut
- Copy and Clone for Closures
- Callbacks
- Using Closures Effectively
- Capturing Variables
- 15. Iterators
- The Iterator and IntoIterator Traits
- Creating Iterators
- iter and iter_mut Methods
- IntoIterator Implementations
- from_fn and successors
- drain Methods
- Other Iterator Sources
- Iterator Adapters
- map and filter
- filter_map and flat_map
- flatten
- take and take_while
- skip and skip_while
- peekable
- fuse
- Reversible Iterators and rev
- inspect
- chain
- enumerate
- zip
- by_ref
- cloned, copied
- cycle
- Consuming Iterators
- Simple Accumulation: count, sum, product
- max, min
- max_by, min_by
- max_by_key, min_by_key
- Comparing Item Sequences
- any and all
- position, rposition, and ExactSizeIterator
- fold and rfold
- try_fold and try_rfold
- nth, nth_back
- last
- find, rfind, and find_map
- Building Collections: collect and FromIterator
- The Extend Trait
- partition
- for_each and try_for_each
- Implementing Your Own Iterators
- 16. Collections
- Overview
- Vec<T>
- Accessing Elements
- Iteration
- Length and Capacity
- Growing and Shrinking Vectors
- Splitting
- Swapping
- Filling
- Sorting and Searching
- Comparing Slices
- Random Elements
- Rust Rules Out Invalidation Errors
- VecDeque<T>
- BinaryHeap<T>
- HashMap<K, V> and BTreeMap<K, V>
- Entries
- Map Iteration
- HashSet<T> and BTreeSet<T>
- Set Iteration
- When Equal Values Are Different
- Whole-Set Operations
- Hashing
- Using a Custom Hashing Algorithm
- Beyond the Standard Collections
- 17. Strings and Text
- Some Unicode Background
- ASCII, Latin-1, and Unicode
- UTF-8
- Text Directionality
- Characters (char)
- Classifying Characters
- Handling Digits
- Case Conversion for Characters
- Conversions to and from Integers
- String and str
- Creating String Values
- Simple Inspection
- Appending and Inserting Text
- Removing and Replacing Text
- Conventions for Searching and Iterating
- Patterns for Searching Text
- Searching and Replacing
- Iterating over Text
- Trimming
- Case Conversion for Strings
- Parsing Other Types from Strings
- Converting Other Types to Strings
- Borrowing as Other Text-Like Types
- Accessing Text as UTF-8
- Producing Text from UTF-8 Data
- Putting Off Allocation
- Strings as Generic Collections
- Formatting Values
- Formatting Text Values
- Formatting Numbers
- Formatting Other Types
- Formatting Values for Debugging
- Formatting Pointers for Debugging
- Referring to Arguments by Index or Name
- Dynamic Widths and Precisions
- Formatting Your Own Types
- Using the Formatting Language in Your Own Code
- Regular Expressions
- Basic Regex Use
- Building Regex Values Lazily
- Some Unicode Background
- 18. Input and Output
- Readers and Writers
- Readers
- Buffered Readers
- Reading Lines
- Collecting Lines
- Writers
- Files
- Seeking
- Other Reader and Writer Types
- Binary Data, Compression, and Serialization
- Files and Directories
- OsStr and Path
- Path and PathBuf Methods
- Filesystem Access Functions
- Reading Directories
- Platform-Specific Features
- Networking
- Readers and Writers
- 19. Threads
- Fork-Join Parallelism
- spawn and join
- Error Handling Across Threads
- Sharing Immutable Data Across Threads
- Rayon
- Revisiting the Mandelbrot Set
- Channels
- Sending Values
- Receiving Values
- Running the Pipeline
- Channel Features and Performance
- Thread Safety: Send and Sync
- Piping Almost Any Iterator to a Channel
- Beyond Pipelines
- Shared Mutable State
- What Is a Mutex?
- Mutex<T>
- mut and Mutex
- Why Mutexes Are Not Always a Good Idea
- Deadlock
- Poisoned Mutexes
- Multiconsumer Channels Using Mutexes
- Read/Write Locks (RwLock<T>)
- Condition Variables (Condvar)
- Atomics
- Global Variables
- Thread-Local Variables
- What Hacking Concurrent Code in Rust Is Like
- Fork-Join Parallelism
- 20. Asynchronous Programming
- What Asynchronous Code Looks Like
- Futures
- Asynchronous Function Future Types
- async Blocks
- Future Lifetimes
- Spawning Asynchronous Tasks
- Listing a Web Pages Outgoing Links
- Spidering the Web Concurrently
- Extracting the Traversals Results
- Waiting Versus Blocking
- Asynchronous Versions of Blocking Tools
- Tasks and static
- Tasks and Send
- Asynchronous Closures
- AsyncFn
- Asynchronous Functions in Traits
- Cancellation
- Cancel Safety
- Racing Futures with tokio::select!
- Shutdown
- Aborting Tasks
- Shutdown Signals
- Cancellation Tokens
- Conclusion
- 21. Futures
- The Future Trait
- Implementing and Instantiating Futures
- How Do We Know When to Poll?
- Invoking Wakers: spawn_blocking
- Implementing block_on
- The Role of Runtimes
- Implementing I/O Futures
- Reactors
- Implementing a Reactor
- Cooperative Multitasking
- Tokios Executor
- Pinning
- The Two Life Stages of a Future
- Pinned Pointers
- The Unpin Trait
- Conclusion
- 22. Macros
- Macro Basics
- Basics of Macro Expansion
- Unintended Consequences
- Repetition
- Built-In Macros
- Debugging Macros
- Building the json! Macro
- Fragment Types
- Recursion in Macros
- Using Traits with Macros
- Scoping and Hygiene
- Importing and Exporting Macros
- Beyond macro_rules!
- Macro Basics
- 23. Unsafe Code
- Unsafe from What?
- unsafe Blocks
- Example: An Efficient ASCII String Type
- Unsafe Functions
- Marking Unsafe Code
- Undefined Behavior
- Unsafe Traits
- Raw Pointers
- Dereferencing Raw Pointers Safely
- Example: RefWithFlag
- Null Pointers
- Type Sizes and Alignments
- Pointer Arithmetic
- Moving Into and Out of Memory
- Example: GapBuffer
- Panic Safety in Unsafe Code
- Unions
- 24. Foreign Functions
- Finding Common Data Representations
- Declaring Foreign Functions and Variables
- Using Functions from Libraries
- A Raw Interface to libgit2
- A Safe Interface to libgit2
- Conclusion
- Index





