Skip to content

Commit

Permalink
remote api docs: add binding code
Browse files Browse the repository at this point in the history
  • Loading branch information
Indra-db authored and SanderMertens committed Jul 11, 2024
1 parent 46ca38e commit 9846544
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions docs/FlecsRemoteApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ world.set<flecs::Rest>({});
while (world.progress()) { }
```

</li>
<li><b class="tab-title">Rust</b>

```rust
// Optional, gather statistics for explorer
world.import::<stats::Stats>();

// Creates REST server on default port (27750)
world.set(flecs::rest::Rest::default());

// Runs the system serving up REST requests
while world.progress() {}
```
</li>
</ul>
</div>
Expand Down Expand Up @@ -77,6 +90,17 @@ world.app()
.run();
```

</li>
<li><b class="tab-title">Rust</b>

```rust
world
.app()
// Optional, gather statistics for explorer
.enable_stats(true)
.enable_rest(0)
.run();
```
</li>
</ul>
</div>
Expand Down Expand Up @@ -268,6 +292,19 @@ world.set<flecs::Rest>({});
while (world.progress()) { }
```

</li>
<li><b class="tab-title">Rust</b>

```rust
// Optional, gather statistics for explorer
world.import::<stats::Stats>();

// Creates REST server on default port (27750)
world.set(flecs::rest::Rest::default());

// Runs the system serving up REST requests
while world.progress() {}
```
</li>
</ul>
</div>
Expand Down

0 comments on commit 9846544

Please sign in to comment.