Rust REPL console
REPL console is an interactive read-eval-print-loop environment for prototyping and testing your Rust code. This handy tool is a notebook, a calculator, and a Rust interpreter all in one.
Implemented on top of the evcxr_repl utility, Rust REPL provides syntax highlighting and completion for the code lines you type. It also shows a pane with the list of variables, functions, and structures currently in use.
You can access the REPL console from the context menu (Rust | Rust REPL), run it from the main menu (Tools | Rust | Rust REPL), or look it up in the Search Everywhere dialog (double ).

Find below an example of how the REPL console can be used to draft a simple program in Rust:

The REPL console has the following controls:
– click to terminate the current REPL session and restart the console.
– click to run the code you have written in the REPL console.
tip
Alternatively, press to execute code immediately after completing the line.
– click to stop Rust REPL.
– click to close the REPL console.
– click to create soft wraps in the message text.
– click to scroll to the end of displayed messages.
– click to print console text.
– click to view the history of entered queries.
– click enable or disable the variables panel.
Once the crate has been added, you can utilize it in your code using the use
command:
use rand::Rng;
let mut rng = rand::thread_rng();
let random_number: u32 = rng.gen_range(1..=10);
println!("Random number: {}", random_number);