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.
![Predefined project template Predefined project template](https://resources.jetbrains.com/help/img/idea/2024.3/rust_predefined_project_templates.png)
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.
When you select the Binary template, RustRover generates a simple project that consists of Cargo.toml and the src folder with main.rs:
![New binary application project New binary application project](https://resources.jetbrains.com/help/img/idea/2024.3/rust_new_project_binary.png)
The IDE automatically creates a Run Cargo configuration that runs the following Cargo command:
run --package project_name --bin project_name
The Library template generates a project that consists of Cargo.toml and the src folder with lib.rs:
![New library project New library project](https://resources.jetbrains.com/help/img/idea/2024.3/rust_new_project_library.png)
For library projects, the IDE creates a Test Cargo configuration that runs the following Cargo command:
test --package project_name --lib tests
RustRover integrates with cargo-generate to help you use Git repositories as project templates.
The WebAssembly Lib template is based on wasm-pack-template.
![WebAssembly project template WebAssembly project template](https://resources.jetbrains.com/help/img/idea/2024.3/ri_prjwizard_webasm.png)
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.
![New WASM project New WASM project](https://resources.jetbrains.com/help/img/idea/2024.3/ri_wasm_project_stub.png)
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.
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
![Custom Git repo as a cargo-generate template Custom Git repo as a cargo-generate template](https://resources.jetbrains.com/help/img/idea/2024.3/rust_new_project_cargogenerate.png)
Thanks for your feedback!