From 255e0297bf53605452a3428513b29eabb4ad5117 Mon Sep 17 00:00:00 2001 From: Indradb <60851042+Indra-db@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:57:46 +0900 Subject: [PATCH] remote api docs: add binding code --- docs/FlecsRemoteApi.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/docs/FlecsRemoteApi.md b/docs/FlecsRemoteApi.md index df8136a41..48993ac1c 100644 --- a/docs/FlecsRemoteApi.md +++ b/docs/FlecsRemoteApi.md @@ -46,6 +46,19 @@ world.set({}); while (world.progress()) { } ``` + +
  • Rust + +```rust +// Optional, gather statistics for explorer +world.import::(); + +// Creates REST server on default port (27750) +world.set(flecs::rest::Rest::default()); + +// Runs the system serving up REST requests +while world.progress() {} +```
  • @@ -77,6 +90,17 @@ world.app() .run(); ``` + +
  • Rust + +```rust +world + .app() + // Optional, gather statistics for explorer + .enable_stats(true) + .enable_rest(0) + .run(); +```
  • @@ -268,6 +292,19 @@ world.set({}); while (world.progress()) { } ``` + +
  • Rust + +```rust +// Optional, gather statistics for explorer +world.import::(); + +// Creates REST server on default port (27750) +world.set(flecs::rest::Rest::default()); + +// Runs the system serving up REST requests +while world.progress() {} +```