Rust Usage
Last updated
Last updated
For examples of how to build a Rust program which compiles and runs on Valida, see . You can use any of these examples as a starting point for developing your own programs using the Valida toolchain. Here are steps for doing so:
Clone the project template:
Basing your project on the project template is not needed unless you require pseudo-random number functions to be available. If that is not the case, then you can replace the above with cargo new fibonacci
.
cd
into the project template:
Enter the Valida shell or the Docker toolchain shell, following the instructions specific to your selected .
Build the project:
Run the code:
If your program requires the pseudo-random number support included in the valida_rs
crate, you need the following boilerplate:
If you do not require random number support, then you don't need any boilerplate in the main.rs
module.
See for more information on how to write Rust programs to run on Valida.