Project templates
When you create a new Cargo project, RustRover asks you to choose a project template. Templates define the project's initial structure, so you don't have to build everything from scratch.
Apart from the predefined options, you can easily create a custom template based on any Git repository. In fact, this is how WebAssembly Lib and Procedural Macro are obtained. For more information, refer to Cargo-generate templates.
Binary application template
When you select the Binary template, RustRover generates a simple project that consists of Cargo.toml and the src folder with main.rs:
The IDE automatically creates a Run Cargo configuration that runs the following Cargo command:
Library template
The Library template generates a project that consists of Cargo.toml and the src folder with lib.rs:
For library projects, the IDE creates a Test Cargo configuration that runs the following Cargo command:
WASM template for new projects
RustRover integrates with cargo-generate to help you use Git repositories as project templates.
The WebAssembly Lib template is based on wasm-pack-template.
When you create a project using this template, the IDE generates a sample structure and automatically adds a Build configuration of the wasm-pack type.
Cargo-generate templates
RustRover integrates with cargo-generate which allows you to use Git repositories as project templates. If you don’t have cargo-generate installed, you will be able to do that from the New Project dialog.
Create a custom template
To create a template based on a Git repo, do the following:
On the Welcome screen, click the icon.
In the Add Custom Template dialog, specify the URL of the Git repo and the template name.
Click Add