Generally there is no need to actually run the program frequently, so you just code for an hour or more and then run the result.
Since Rust has an actual type system, decent programmers usually produce code that works correctly the first time it successfully compiles, so running and testing it is not so important.
If you still need to run many code snippets frequently, create a command line tool with an option parser (e.g. clap in Rust), and create a subcommand for each "code snippet" and you can then invoke them from the command line along with whatever options you need.
You can also use debuggers or add eprintln! calls in existing codebases.
If you are just learning the language and want to test simple examples you can also use online playgrounds like https://play.rust-lang.org
Since Rust has an actual type system, decent programmers usually produce code that works correctly the first time it successfully compiles, so running and testing it is not so important.
If you still need to run many code snippets frequently, create a command line tool with an option parser (e.g. clap in Rust), and create a subcommand for each "code snippet" and you can then invoke them from the command line along with whatever options you need.
You can also use debuggers or add eprintln! calls in existing codebases.
If you are just learning the language and want to test simple examples you can also use online playgrounds like https://play.rust-lang.org