Professional Rust: Advanced Techniques
Professional Rust: Advanced Techniques
Summary:
The book "Professional Rust: Advanced Techniques" is a practical guide for developers who have already mastered the basics of the Rust language and want to move to the next level. The author, Alexey Sokolov, an experienced systems engineer and contributor to open-source projects in Rust, shares deep knowledge that is usually acquired through years of practice.
What is this book about?
The book is dedicated to advanced and highly specialized topics that are rarely covered in introductory tutorials. You will learn:
- Working with unsafe code: understanding safety rules, creating safe abstractions over raw pointers, working with uninitialized memory.
- Macros: declarative macros (macro_rules!) and procedural macros (derive, attribute, function-like) for code generation.
- FFI and C interop: calling C functions, exporting Rust functions for C, working with external libraries and ABI.
- Asynchronous programming: deep dive into Future, async/await, Pin, creating your own Executor and Reactor.
- Performance optimization: profiling, cache locality, inlining, SIMD instructions, and zero-cost abstractions.
- Parallelism and concurrency: Send/Sync, Arc, Mutex, RwLock, channels, lock-free data structures.
Who is this book for?
The book is intended for experienced developers who:
- Have already written several projects in Rust and want to understand how the language works "under the hood."
- Plan to use Rust for systems programming, embedded systems, game engines, or high-load services.
- Want to master writing safe wrappers over C libraries (FFI) or create their own DSL using macros.
- Strive to write the most efficient code without sacrificing safety.
What will you learn?
After reading, you will be able to confidently work with unsafe code, create complex macros, integrate Rust with other languages, design asynchronous systems, and optimize performance. You will not just learn to write code — you will understand why it works the way it does, and you will be able to avoid pitfalls that await even experienced developers.
The book contains numerous code examples, practical exercises, and real-world industry cases. It is a must-read for anyone who wants to become an expert in Rust.