Skip to content

Commit

Permalink
Replace duplicated text with a link
Browse files Browse the repository at this point in the history
  • Loading branch information
temeddix committed Nov 23, 2023
1 parent b5367ed commit f0aef33
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
8 changes: 2 additions & 6 deletions documentation/docs/rust-resource-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ Each `.proto` file located in `./messages` and its subfolders is treated as a Ru

Each Rust resource will be assigned a unique `ID` on code generation, which is inserted into the `resource` field of `RustRequest` and `RustSignal` to distinguish which Rust resource that the message is trying to talk about.

When you generate message code using the `rinf message` command, the resulting Dart and Rust modules' names and subpaths will precisely correspond to those of the `.proto` files.

- `./messages`: `.proto` input files
- `./lib/messages`: `.dart` output files
- `./native/hub/src/messages`: `.rs` output files

This framework follows the RESTful API pattern, allowing for the definition of 9 possible message combinations within each `.proto` file like below. However, it's totally acceptable to create other message types as well.

```proto
Expand All @@ -26,4 +20,6 @@ message DeleteResponse { ... }
message StateSignal { ... }
```

For more details about generating message code, refer to the [message code section](writing-code.md#message-code-generation).

> We highly recommend NOT version-controlling the generated message code. This framework writes folders containing the generated code to `.gitignore` when applying the template to prevent unnecessarily bloated Git history. Usually, only version-controlling `.proto` files is enough.
18 changes: 10 additions & 8 deletions documentation/docs/writing-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,25 +316,27 @@ While Rinf's API system may resemble that of web development, it relies only on

### Path

- `./messages` : The `.proto` files under here and its subdirectories will be used to generating message code.
When you generate message code using the `rinf message` command, the resulting Dart and Rust modules' names and subpaths will precisely correspond to those of the `.proto` files.

- `./messages` : The `.proto` files under here and its subdirectories will be used to generating message code.
- `./lib/messages` : The generated Dart code will be placed here.

- `./native/hub/src/messages` : The generated Rust code will be placed here.

### Continuous Message Generation

If you add the optional argument `-w` or `--watch` to the `rinf message` command, the message code will automatically generated when `.proto` files are modified. When you add this argument, the command will not exit on its own.
If you add the optional argument `-w` or `--watch` to the `rinf message` command, the message code will automatically generated when `.proto` files are modified. If you add this argument, the command will not exit on its own.

```bash
rinf message --watch
```

| | Recursively Watch | Recursively Generate |
| ------- | ----------------- | -------------------- |
| Linux |||
| macOS |||
| Windows |||
Currently, recursive watching is not supported on all platforms.

| | While watching | One-time gen |
| ------- | -------------- | ------------ |
| Linux |||
| macOS |||
| Windows |||

## 🖨️ Printing for Debugging

Expand Down

0 comments on commit f0aef33

Please sign in to comment.