Code generation
RustRover provides multiple ways to generate Rust code constructs and recurring elements. There are many intention actions and quick-fixes which can help you quickly insert the required code based on the current content. You can also use live templates (both custom and pre-generated), various code wrappers, postfix completion, and file templates for Cargo crates.
Generate popup
At any place in your code, call the Generate menu by pressing Alt+Insert or selecting from the main menu. It gives a list of the possible code generation actions, depending on the current context, caret position, or selected code:
For example, you can quickly generate a setter for a struct:
Creating a Cargo crate
In addition to code templates, you can use the Cargo.toml and an src subdirectory containing main.rs.
action to quickly add a Cargo crate into your project. RustRover will generate a directory withRight-click in the Project view and select New | Cargo Crate. Alternatively, call Help | Find Action (Ctrl+Shift+A) and search for Cargo Crate:
Specify the crate name and type:
The automatically generated folders and files will be placed under the project root: