RustRover 2023.3 Help

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

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:

New binary application project

The IDE automatically creates a Run Cargo configuration that runs the following Cargo command:

run --package project_name --bin project_name

Library template

The Library template generates a project that consists of Cargo.toml and the src folder with lib.rs:

New library project

For library projects, the IDE creates a Test Cargo configuration that runs the following Cargo command:

test --package project_name --lib tests

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.

WebAssembly project 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.

New WASM project

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:

  1. On the Welcome screen, click the icon.

  2. In the Add Custom Template dialog, specify the URL of the Git repo and the template name.

  3. Click Add

Custom Git repo as a cargo-generate template
Last modified: 08 April 2024