1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! The REST module provides a small REST API for accessing application data remotely.
//!
//! This module uses the HTTP server and JSON serializer to provide access to ECS data,
//! enabling remote inspection, debugging, and monitoring of your Flecs application.
//! The REST API is commonly used with tools like the Flecs Explorer web interface.
//!
//! # Features
//!
//! - **Remote Access**: Query entities, components, and systems over HTTP
//! - **JSON Serialization**: Automatic serialization of ECS data to JSON
//! - **Explorer Integration**: Works seamlessly with the Flecs Explorer web UI
//! - **Real-time Monitoring**: Monitor application state in real-time
//!
//! # Usage
//!
//! Enable the REST server by adding a [`Rest`] component to a singleton entity,
//! or use the [`App::enable_rest()`](crate::addons::app::App::enable_rest) method
//! when using the app addon.
//!
//! # Example
//!
//! ```no_run
//! use flecs_ecs::prelude::*;
//!
//! let world = World::new();
//!
//! // Enable REST API on port 27750 (default)
//! world.set(flecs::rest::Rest::default());
//!
//! // Or use the app addon for simpler setup
//! world.app()
//! .enable_rest(27750)
//! .run();
//! ```
//!
//! Once enabled, you can access the REST API at `http://localhost:27750`.
//!
//! # API Reference
//!
//! For detailed REST API endpoint documentation and usage, see the
//! [Flecs REST API Manual](https://www.flecs.dev/flecs/md_docs_2RestApi.html).
//!
//! # See also
//!
//! - [`Rest`] - Component to enable the REST server
//! - [`App::enable_rest()`](crate::addons::app::App::enable_rest) - Enable REST via the app addon
//! - [Flecs Explorer](https://www.flecs.dev/explorer) - Web-based ECS inspector
//! - [REST API Manual](https://www.flecs.dev/flecs/md_docs_2FlecsRemoteApi.html)
use *;
// REST module components
impl_component_traits_binding_type_w_id!;
unsafe
unsafe