Go beyond the basics and build complete applications using the Rust programming language. The applications in this book include a high-performance web client, a microcontroller (for a robot, for example), a game, an app that runs on Android, and an application that incorporates AI and machine learning. Each chapter will be organized in the following format: what this kind of application looks like; requirements and user stories of our example program; an introduction to the Rust libraries used; the actual implementation of the example program, including common pitfalls and their solutions; and a brief comparison of libraries for building each application, if there is no clear winner.
Practical Rust Projects will open your eyes to the world of practical applications of Rust. After reading the book, you will be able to apply your Rust knowledge to build your own projects.
What You Will Learn Write Rust code that runs on microcontrollers Build a 2D game Create Rust-based mobile Android applications Use Rust to build AI and machine learning applications Who This Book Is ForSomeone with basic Rust knowledge, wishing to learn more about how to apply Rust in a real-world scenario.
Chapter 1, IntroductionThis chapter gives a short introduction to why Rust is a solid tool for building all kinds of application, and a brief overview of the format and organization of the book._Introduction_Why Rust?_Who should read this book?_Chapters overviewChapter 2, Building a command-line programThis chapter will teach you how to build a command-line program with Rust._What are we going to build? (We\'ll build a cowsay-like tool)_Building a binary program in Rust_Handling positional arguments_Handling optional arguments_Building a text-based user interface with ncurses_SummaryChapter 3, Creating graphical user interfaces (GUIs)This chapter will teach you how to build a cross-platform GUI program in Rust._What are we going to build? (A desktop cat breed photo viewer)_Introduction to GTK+_Components of a GUI program_Creating a window_Handling user input_Supporting multiple operating system_SummaryChapter 4, Building a gameThis chapter will teach you how to build an 2D game with Rust_What are we going to build? (A 2D cat volleyball game)_Game frameworks in Rust_Building a 2D game in Rust_Rendering the map_Controlling the character with keyboard_Enemies incoming!_Adding sound effects_SummaryChapter 5, Going mobileThis chapter will demonstrate how to build an Android app using Rust_How to make Rust run on Android_What are we going to build? (A pokedex-like cat breed catalog)_Building the app skeleton_Showing pictures_Adding searchChapter 6, Programming embedded devicesThis chapter will demonstrate how to program an embedded device in Rust using a hardware development board. We\'ll also be using a QEUM emulator so readers can follow along without the hardware._What are we going to build? (Either a STM32 development board or Arduino, still need more research)_How cross-compilation works?_Introducing the development board and QEUM_Setting up the toolchain for embedded programming_Communication using serial port_Programming the hardware timer_Debugging on an embedded device_SummaryChapter 7, Artificial intelligence and machine learningThis chapter will introduce machine learning libraries in Rust and show a simple image recognition demo_How does machine learning work_What are we going to build? (A cat image detector)_Mathematical background_Preparing the dataset_Training the model_Making predictionsChapter 8, Advanced topicsThis chapter will discuss other more advanced use of Rust. Each section will introduce one application, existing projects for that kind of application and their status. But we\'ll not go into the detail as the previous chapters._Working with other languages_Operating system - Redox_The vast universe of Rust applications