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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//! Flecs is a fast and lightweight Entity Component System that lets you build games and simulations with millions of entities.
//!
//! This library provides a comprehensive and low-overhead Rust binding for [Flecs](https://github.com/SanderMertens/flecs) an ECS written in C.
//!
//! ## Documentation
//!
//! - The **[flecs.dev](https://www.flecs.dev/)** website contains comprehensive documentation on Flecs on its features & how to use it for Rust and other languages.
//! - **[Component Macro](component_macro/index.html)** - Complete guide to the `#[derive(Component)]` macro and all its attributes.
//! - **[DSL Macro](dsl/index.html)** - Query, system, and observer DSL documentation
//!
//! ## Safety
//!
//! This crate enables additional runtime checks by default to preserve Rust's
//! borrowing and concurrency guarantees when calling into the underlying C
//! Flecs library. Those checks are provided by the `flecs_safety_locks` feature
//! (enabled by default) and help prevent unsafe aliasing and concurrent mutable
//! access across Flecs callbacks, systems and queries.
//!
//! These safety checks imposes a runtime cost. If you fully understand the
//! characteristics of your application and need maximum performance,
//! you may disable `flecs_safety_locks` (e.g. for a Release). Disabling it will
//! improve throughput but removes the runtime protections and may lead to
//! undefined behavior if the API is used in an unsafe way. This might or might not matter
//! depending on the application.
//this is commented since `no_std` is not ready yet
//#![cfg_attr(not(feature = "std"), no_std)] // Enable `no_std` if `std` feature is disabled
compile_error!;
const _: = panic!;
extern crate std;
extern crate alloc;
pub use flecs_ecs_derive as macros;
pub use flecs_ecs_sys as sys;
/// Flecs Rust DSL documentation and examples.
///
/// This module contains comprehensive documentation for the Flecs Rust DSL, including:
/// - Query syntax and operators
/// - System and observer macros
/// - Complete working examples
///
/// All code examples in this module are tested with `cargo test --doc`.
///
/// See the [dsl module documentation](dsl/index.html) for the full guide.
/// Component derive macro documentation and usage guide.
///
/// This module contains comprehensive documentation for the `Component` derive macro, including:
/// - Basic component registration
/// - Component traits (Transitive, Sparse, etc.)
/// - Hooks (on_add, on_set, on_remove, on_replace)
/// - Add and set attributes
/// - Meta information
/// - Common patterns and best practices
/// this is to allow using the proc macro's inside lib itself that implements its own traits.
extern crate self as flecs_ecs;