Chapter 11: Best Practices for Integrating Rust
In Chapter 10, Injecting Rust into a Python Flask App, we managed to fuse our Rust code with a Python web application. In this final chapter, we will wrap up what we have covered in the book with best practices. These practices are not essential to fuse Rust with Python; however, they will help us in avoiding pitfalls when building bigger packages in Rust. When it comes to best practices, we can Google search the topic SOLID principles, which will give us loads of free information on how to keep code generally clean. But instead of regurgitating these principles, we will cover concepts that are specific to using Rust and Python together. We will learn how to keep the Rust/Python implementation as simple as possible if the requirements are not too demanding. We will also understand what Python and Rust excel in when it comes to computational tasks and Python interfaces. We then investigate traits in Rust and how they can help us organize...