You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/user_guide/instructions_to_run_generated_code.md
+62-1Lines changed: 62 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -945,7 +945,68 @@ TODO
945
945
946
946
## Rust (reqwest)
947
947
948
-
TODO
948
+
### 1. Download and Install Rust:
949
+
950
+
#### **Windows**
951
+
1. Download and install `rustup` from [Rustup Official Site](https://rustup.rs).
952
+
2. Run the installer (`rustup-init.exe`) and follow the instructions.
953
+
3. Restart your terminal (Command Prompt or PowerShell).
954
+
4. Verify the installation:
955
+
```sh
956
+
rustc --version
957
+
cargo --version
958
+
```
959
+
960
+
#### **MacOS/Linux**
961
+
1. Run the following in your terminal:
962
+
```sh
963
+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
964
+
```
965
+
then follow the on-screen instructions.
966
+
967
+
2. Restart the terminal and verify:
968
+
```sh
969
+
rustc --version
970
+
cargo --version
971
+
```
972
+
973
+
> Note: If you prefer not to use rustup for some reason, please see the Other [Rust Installation Methods](https://forge.rust-lang.org/infra/other-installation-methods.html) page for more options.
974
+
975
+
### 2. Set Up a New Rust Project
976
+
1. Open a terminal and create a new Rust project:
977
+
```sh
978
+
cargo new reqwest-demo
979
+
```
980
+
2. Navigate into the project directory:
981
+
```sh
982
+
cd reqwest-demo
983
+
```
984
+
985
+
or open this project directory in your preferred code editor.
986
+
987
+
### 3. Add Necessary Dependencies
988
+
Run the following command to add dependencies:
989
+
```sh
990
+
cargo add reqwest --features blocking,json
991
+
cargo add tokio --features full
992
+
```
993
+
- `"blocking"`: Enables synchronous requests.
994
+
- `"json"`: Allows JSON parsing.
995
+
- `"tokio"`: Needed for asynchronous execution.
996
+
997
+
Run the following command to fetch dependencies:
998
+
```sh
999
+
cargo build
1000
+
```
1001
+
1002
+
### 4. Execute code
1003
+
1. Copy the generated code from API Dash.
1004
+
2. Paste the code into your project's `src/main.rs` directory
0 commit comments