Skip to content

Commit da87372

Browse files
committed
docs(codegen): add detailed instructions for ureq
1 parent 8b12a72 commit da87372

File tree

1 file changed

+58
-1
lines changed

1 file changed

+58
-1
lines changed

doc/user_guide/instructions_to_run_generated_code.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,64 @@ TODO
949949

950950
## Rust (ureq)
951951

952-
TODO
952+
### 1. Download and Install Rust:
953+
954+
#### **Windows**
955+
1. Download and install `rustup` from [Rustup Official Site](https://rustup.rs).
956+
2. Run the installer (`rustup-init.exe`) and follow the instructions.
957+
3. Restart your terminal (Command Prompt or PowerShell).
958+
4. Verify the installation:
959+
```sh
960+
rustc --version
961+
cargo --version
962+
```
963+
964+
#### **MacOS/Linux**
965+
1. Run the following in your terminal:
966+
```sh
967+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
968+
```
969+
then follow the on-screen instructions.
970+
971+
2. Restart the terminal and verify:
972+
```sh
973+
rustc --version
974+
cargo --version
975+
```
976+
977+
> 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.
978+
979+
### 2. Set Up a New Rust Project
980+
1. Open a terminal and create a new Rust project:
981+
```sh
982+
cargo new ureq-demo
983+
```
984+
2. Navigate into the project directory:
985+
```sh
986+
cd ureq-demo
987+
```
988+
989+
or open this project directory in your preferred code editor.
990+
991+
### 3. Add `ureq` Dependency
992+
993+
Run the following command to add dependencies:
994+
```sh
995+
cargo add ureq
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
1005+
1006+
Run the generated code:
1007+
```sh
1008+
cargo run
1009+
```
9531010
9541011
## Rust (Actix Client)
9551012

0 commit comments

Comments
 (0)