RustIt is a general compiled language developed by Mozilla. Its design criterion is “safe, concurrent and practical”, and supports functional, parallel, procedural and object-oriented programming styles.
IntelliJ is one of the best used java ides. It supports a variety of plug-ins, includingintellij-rustnamely
RustFor the plug-in on IntelliJ, you can use the plug-in to develop rust on IntelliJ. Here is a brief introduction to how to install rust and use IntelliJ as its ide.
When installing rust, do not directly use the rust language itself, for example
brew install rustJust install the trust language itself. What should be installed is
rustupIt is the management tool of the official version of trust and the first choice for installing trust. Its main features are:
- Manage rust binaries
- Configure rust tool chain
- Manage rust related components
- Rely only on bash, curl, and common UNIX tools
- Support multi platform
The tools often used in the development process of using rust are
cargo, these can be managed using rustup.
cargoIt is a tool for rust project management and provides a series of tools, from project establishment, construction to testing, operation to deployment, which provide the means to complete the management of rust project as much as possible.
rustcIs a compiler for the trust language.
rust-srcIs the trust standard library.
curl https://sh.rustup.rs -sSf | sh
During the installation process, you will be asked to select the installation method. You can install it by default
cargo。 After installation, you need to set two directories into the path variable:
- $home /. Cargo / bin, bin directory of cargo
- $home /. Cargo / Env, directory configured for shell
rustup helpYou can see the relevant commands of rustup. The above default does not include components
rust-srcInstallation of requires separate installation of components
rustup component add rust-src
In this way, the environment installation of rust has been completed. The components to be used in the IDE using IntelliJ as rust include:
Installing the IntelliJ plug-in
Two plug-ins need to be installed
intellij-rustIt’s a rust language plug-in,
intellij-tomlIt is a plug-in for the toml language and is used for the cargo configuration file cargo.toml.
Perferences.. -> Plugins Search rust directly in the marketplace
Search in the same way
After installing the plug-in, you can create a new project and select rust:
You can see that the toolchain location is the configured $home /. Cargo / bin, and the standard library is installed before
After the project is created successfully, you can see a complete trust project: