Skip to content

Commit bc5564b

Browse files
authored
Merge pull request #698 from Udhay-Adithya/add-ureq-docs
docs(codegen): add detailed instructions for ureq
2 parents 5229f99 + da87372 commit bc5564b

File tree

1 file changed

+58
-1
lines changed

1 file changed

+58
-1
lines changed

Diff for: doc/user_guide/instructions_to_run_generated_code.md

+58-1
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,64 @@ cargo run
10101010
10111011
## Rust (ureq)
10121012
1013-
TODO
1013+
### 1. Download and Install Rust:
1014+
1015+
#### **Windows**
1016+
1. Download and install `rustup` from [Rustup Official Site](https://rustup.rs).
1017+
2. Run the installer (`rustup-init.exe`) and follow the instructions.
1018+
3. Restart your terminal (Command Prompt or PowerShell).
1019+
4. Verify the installation:
1020+
```sh
1021+
rustc --version
1022+
cargo --version
1023+
```
1024+
1025+
#### **MacOS/Linux**
1026+
1. Run the following in your terminal:
1027+
```sh
1028+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
1029+
```
1030+
then follow the on-screen instructions.
1031+
1032+
2. Restart the terminal and verify:
1033+
```sh
1034+
rustc --version
1035+
cargo --version
1036+
```
1037+
1038+
> 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.
1039+
1040+
### 2. Set Up a New Rust Project
1041+
1. Open a terminal and create a new Rust project:
1042+
```sh
1043+
cargo new ureq-demo
1044+
```
1045+
2. Navigate into the project directory:
1046+
```sh
1047+
cd ureq-demo
1048+
```
1049+
1050+
or open this project directory in your preferred code editor.
1051+
1052+
### 3. Add `ureq` Dependency
1053+
1054+
Run the following command to add dependencies:
1055+
```sh
1056+
cargo add ureq
1057+
```
1058+
Run the following command to fetch dependencies:
1059+
```sh
1060+
cargo build
1061+
```
1062+
1063+
### 4. Execute code
1064+
1. Copy the generated code from API Dash.
1065+
2. Paste the code into your project's `src/main.rs` directory
1066+
1067+
Run the generated code:
1068+
```sh
1069+
cargo run
1070+
```
10141071

10151072
## Rust (Actix Client)
10161073

0 commit comments

Comments
 (0)