Project specific development environments are a good use case for setting up a container for all the tools and libraries you need.
There’s a rust container image on Docker Hub which is maintained by the Rust developers - https://hub.docker.com/_/rust
Alternatively, use toolbox to create a reusable container environment that contains the specific Rust bits you need - https://github.com/debarshiray/toolbox