Learn Rust Programming: Safe Code, Supports Low Level and Embedded Systems Programming with a Strong Ecosystem
- Length: 268 pages
- Edition: 1
- Language: English
- Publisher: BPB Publications
- Publication Date: 2022-06-30
- ISBN-10: 935551154X
- ISBN-13: 9789355511546
- Sales Rank: #0 (See Top 100 Books)
Become a Rustacean and a successful software engineer
Key Features
- Introduces Rust’s fundamentals, key concepts, syntax, toolkit, and frameworks
- Extensive examples demonstrating dependable, efficient, and understandable code for producing maintainable software
- Includes coding challenges and useful exercises to make learning to code fun
Description
“Learn Rust Programming” assists every programmer in learning Rust and filling in the gaps left by other programming languages in developing full-proof apps and systems. This book covers every vital feature a programmer requires, including basic principles, syntax, clean coding, application testing, popular libraries, and numerous examples and small programmes.
As a first step in understanding the language, this book tries to present a profoundly practical method for overcoming this learning curve. Using engaging coding challenges and practical projects, the reader can anticipate learning programming fundamentals, developing advanced concurrent code, contributing to open-source projects, and ultimately pursuing a career in Rust. In addition to programming, this book covers the fundamentals of software engineering to develop maintainable and well-documented projects with the help of built-in tools.
As novice software engineers, readers of this book will be able to develop excellent software independently as part of a bigger team. Using Rust, they can join one of the numerous crypto, gaming, IoT, or cloud infrastructure organizations to mark their success of knowledge.
What you will learn
- Learn Rust’s syntax, variables, control structures, enums, and traits.
- Write unit tests, integration tests, and documentation for the software codes.
- Use data structures, commands for running cargo, and any third-party libraries.
- Create durable and maintainable programmes by structuring code correctly.
- Use generics, lifetimes, I/O runtimes, concurrency, and futures in your code.
- Developing declarative macros and taking advantage of heap memory.
Who this book is for
This book interests all kinds of sound programmers who want their applications to be efficient and reliable over time. It also attracts novices and recent graduates who wish to become young programmers with a solid grasp of the programming language of the 21st century.
Cover Page Title Page Copyright Page Dedication Page About the Author Acknowledgement Preface Errata Table of Contents 1. Building the Basics Structure Objectives Compiling Rust code What is compilation Memory management and dynamic versus static typing Executing the code Programming in Rust Managing memory in Rust Writing Rust code Working with variable types Being literal Conclusion Challenge 2. Controlling the Program Flow Structure Objectives Making decisions with if Using conditions What if condition fails Using If/Else expressions Repetitions and repetitions with loop Continuing and breaking with values Enumerating with for Breaking on conditions with while Conclusion Challenge 3. Organizing for Reuse Structure Objectives Encapsulating behavior with functions Parameterizing functions Encapsulating data with structs Getting a deeper look Exporting and importing with modules Aliasing types and exporting imports Conclusion Challenge 4. Interfacing with Code and Errors Structure Objectives Using traits for fun and pleasure Implementing traits Using traits in functions Creating variations with enums Handling errors with enums Matching patterns to extract data Conclusion Challenge Further reading 5. Borrowing Ownership with Scopes Structure Objectives Taking ownership of memory Working with both kinds of memory Borrowing memory Working in scopes Controlling mutability Introducing clones Conclusion Challenge 6. Working with Collections Structure Objectives Using sequential collections: slices and Vec<T> Operating the Vec<T> Borrowing the Vec<T>: slices Deriving keys from values with sets and maps Sorting keys: trees and hashes Using sets and maps Iterating over any collection Chaining iterators together Collecting the results Conclusion Challenge Further reading 7. Reading Input and Writing Output Structure Objectives Reading from and writing to I/O streams Console, networking, and file systems Using formatted print Configuration options for programs Using command-line arguments Using environment variables Conclusion Challenge 8. Using Crates with Cargo Structure Objectives Creating crates with cargo Writing the build manifest Adding third-party crates Going deeper into cargo Customizing the build Using workspaces for large projects Conclusion Challenge Further reading 9. Testing What you Build Structure Objectives Testing Rust code Testing units Testing integration Benchmarking Rust code Conclusion Challenge 10. Documenting What You Build Structure Objectives Documenting Rust code Using sections, links, and others Writing documentation tests Publishing your documentation Conclusion Challenge 11. Generating Code with Macros Structure Objectives Declarative macros Using arguments with names and designators Adding complexity to arguments Exporting macros Procedural macros Writing function-like macros Deriving stuff with macros Using attributes to extend code Conclusion Challenge 12. Using Heap Memory Effectively Structure Objectives Putting things in boxes Boxing data Boxing behavior Counting references Counting references with multi-threading Creating mutability as required Using locks for global mutability Conclusion Challenge Further reading 13. Running Concurrent Code Structure Objectives Threading with Rust Using Send and Sync Using alternatives Bridging threads with channels Conclusion Challenge 14. Writing Async Code Structure Objectives Scheduling tasks in a loop Polling futures Using futures-rs Using async-std Working asynchronously Running blocking code Conclusion Challenge 15. Working with Generics Structure Objectives Using Generics Parameterizing functions Parameterizing structs, traits, and enums Going deeper Using const Generics Working with lifetimes Conclusion Challenge 16. Calling Unsafe and Foreign Functions Structure Objectives Working with unsafe Sharing native Rust code Importing a shared library Binding Rust code Exporting as shared library Conclusion Further reading Index
Donate to keep this site alive
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.