pub struct Query<T>where
T: QueryTuple,{
pub query: NonNull<ecs_query_t>,
/* private fields */
}Expand description
Query for iterating over entities that match a set of conditions.
Queries are the primary way to find and iterate over entities in Flecs. They efficiently match entities based on components, relationships, and other criteria. Queries can be cached for fast repeated iteration or uncached for one-time use.
๐ For comprehensive documentation, see the Flecs Query Manual
ยงCreating Queries
Queries are created using World::new_query() for simple cases or World::query()
when you need a builder for complex conditions:
// Simple query - creates cached query immediately
let q1 = world.new_query::<(&Position, &Velocity)>();
// Complex query - use builder for additional conditions
let q2 = world
.query::<(&Position, &Velocity)>()
.without(flecs::Prefab)
.build();ยงIteration
Queries provide multiple iteration methods:
// Simple iteration over components
query.each(|(pos, vel)| {
pos.x += vel.x;
});
// Iteration with entity access
query.each_entity(|entity, (pos, vel)| {
println!("{} at ({}, {})", entity.name(), pos.x, pos.y);
});
// Low-level table iteration for maximum performance
query.run(|mut it| {
while it.next() {
let mut pos = it.field_mut::<Position>(0);
let vel = it.field::<Velocity>(1);
for i in it.iter() {
pos[i].x += vel[i].x;
}
}
});ยงCached vs Uncached
Queries can be cached or uncached:
- Uncached (created with
new_query()): Fast creation, slower iteration - Cached (created with
new_query_named()or explicit cache kind): Slower creation, fast iteration
Use the builderโs set_cache_kind() to control caching behavior:
// Uncached - good for one-off queries
let uncached = world.new_query::<&Position>();
// Cached - good for repeated queries
let cached = world.new_query_named::<&Position>("positions");
// Explicit control
let custom = world
.query::<&Position>()
.set_cache_kind(QueryCacheKind::Auto)
.build();ยงLifetime and Ownership
Queries are reference-counted and can be cloned cheaply. They remain valid as long as the world exists. Attempting to use a query after its world is destroyed will panic.
let query = world.new_query::<&Position>();
let query_clone = query.clone(); // Cheap - just increments refcountยงExamples
ยงReturning Queries from Functions
// The 'static lifetime ensures components live long enough
fn create_foo_query(world: &World) -> Query<&'static Foo> {
world.new_query::<&Foo>()
}
let query = create_foo_query(&world);
query.each(|foo| { /* ... */ });ยงComplex Query Conditions
let query = world
.query::<(&Position, &Velocity)>()
.with(Enemy)
.without(flecs::Prefab)
.build();ยงSee Also
QueryBuilderfor building complex queriesWorld::new_query()for creating simple cached queriesWorld::query()for creating query buildersWorld::each()for one-off iterations without creating a query- Module documentation for comprehensive query examples
- Flecs Query Manual
Fieldsยง
ยงquery: NonNull<ecs_query_t>Implementationsยง
Sourceยงimpl<T> Query<T>where
T: QueryTuple,
impl<T> Query<T>where
T: QueryTuple,
Sourcepub unsafe fn new_from(query: NonNull<ecs_query_t>) -> Self
pub unsafe fn new_from(query: NonNull<ecs_query_t>) -> Self
wraps the query pointer in a new query
ยงSafety
this is unsafe due to the fact that the type of the query is not checked.
the user is responsible for ensuring that the query is of the correct type.
if not possible, only use .iter functions that do not pass in the components in the callback
ยงArguments
query- The query pointer to wrap
Sourcepub fn destruct(self)
pub fn destruct(self)
Destroy a query and its resources.
If the query is used as the parent of subqueries, those subqueries will be orphaned and must be deinitialized as well.
Examples found in repository?
75fn main() {
76 let world = World::new();
77
78 // Register components in order so that id for First is lower than Third
79 world.component::<First>();
80 world.component::<Second>();
81 world.component::<Third>();
82
83 // Grouped query
84 let query = world
85 .query::<(&Position,)>()
86 .group_by(Group)
87 // Callback invoked when a new group is created
88 .on_group_create(Some(callback_group_create))
89 // Callback invoked when a group is deleted
90 .on_group_delete(Some(callback_group_delete))
91 .build();
92
93 // Create entities in 6 different tables with 3 group ids
94 world
95 .entity()
96 .add((Group, Third))
97 .set(Position { x: 1.0, y: 1.0 });
98 world
99 .entity()
100 .add((Group, Second))
101 .set(Position { x: 2.0, y: 2.0 });
102 world
103 .entity()
104 .add((Group, First))
105 .set(Position { x: 3.0, y: 3.0 });
106
107 world
108 .entity()
109 .add((Group, Third))
110 .set(Position { x: 4.0, y: 4.0 })
111 .add(Tag);
112 world
113 .entity()
114 .add((Group, Second))
115 .set(Position { x: 5.0, y: 5.0 })
116 .add(Tag);
117 world
118 .entity()
119 .add((Group, First))
120 .set(Position { x: 6.0, y: 6.0 })
121 .add(Tag);
122
123 println!();
124
125 // The query cache now looks like this:
126 // - group First:
127 // - table [Position, (Group, First)]
128 // - table [Position, Tag, (Group, First)]
129 //
130 // - group Second:
131 // - table [Position, (Group, Second)]
132 // - table [Position, Tag, (Group, Second)]
133 //
134 // - group Third:
135 // - table [Position, (Group, Third)]
136 // - table [Position, Tag, (Group, Third)]
137 //
138
139 query.run(|mut it| {
140 while it.next() {
141 let group = world.entity_from_id(it.group_id());
142 let pos = it.field::<Position>(0);
143
144 let ctx = unsafe { &*(query.group_context(group) as *mut GroupCtx) };
145 println!(
146 "Group: {:?} - Table: [{:?}] - Counter: {}",
147 group.path().unwrap(),
148 it.archetype(),
149 ctx.counter
150 );
151
152 for i in it.iter() {
153 println!(" [{:?}]", pos[i]);
154 }
155
156 println!();
157 }
158 });
159
160 // Deleting the query will call the on_group_deleted callback
161 query.destruct();
162
163 // Output:
164 // Group created: "Third"
165 // Group created: "Second"
166 // Group created: "First"
167 //
168 // Group: "::First" - Table: [Position, (Group,First)] - Counter: 3
169 // [Position { x: 3.0, y: 3.0 }]
170 //
171 // Group: "::First" - Table: [Position, Tag, (Group,First)] - Counter: 3
172 // [Position { x: 6.0, y: 6.0 }]
173 //
174 // Group: "::Second" - Table: [Position, (Group,Second)] - Counter: 2
175 // [Position { x: 2.0, y: 2.0 }]
176 //
177 // Group: "::Second" - Table: [Position, Tag, (Group,Second)] - Counter: 2
178 // [Position { x: 5.0, y: 5.0 }]
179 //
180 // Group: "::Third" - Table: [Position, (Group,Third)] - Counter: 1
181 // [Position { x: 1.0, y: 1.0 }]
182 //
183 // Group: "::Third" - Table: [Position, Tag, (Group,Third)] - Counter: 1
184 // [Position { x: 4.0, y: 4.0 }]
185 //
186 // Group deleted: "Second"
187 // Group deleted: "First"
188 // Group deleted: "Third"
189}pub fn reference_count(&self) -> i32
Sourcepub fn get_iter_raw(&mut self) -> ecs_iter_t
pub fn get_iter_raw(&mut self) -> ecs_iter_t
Sourcepub fn is_changed(&self) -> bool
pub fn is_changed(&self) -> bool
Returns whether the query data changed since the last iteration.
This operation must be invoked before obtaining the iterator, as this will reset the changed state.
ยงReturns
The operation will return true after:
- new entities have been matched with
- matched entities were deleted
- matched components were changed
Otherwise, it will return false.
ยงSee also
Examples found in repository?
24fn main() {
25 let world = World::new();
26
27 // Make Dirty inheritable so that queries can match it on prefabs
28 world
29 .component::<Dirty>()
30 .add_trait::<(flecs::OnInstantiate, flecs::Inherit)>();
31
32 // Create a query that just reads a component. We'll use this query for
33 // change tracking. Change tracking for a query is automatically enabled
34 // when query::changed() is called.
35 // Each query has its own private dirty state which is reset only when the
36 // query is iterated.
37
38 let query_read = world
39 .query::<&Position>()
40 .detect_changes()
41 .set_cached()
42 .build();
43
44 // Create a query that writes the component based on a Dirty state.
45 let query_write = world
46 .query::<(&Dirty, &mut Position)>()
47 .term_at(0)
48 .up_id(id::<flecs::IsA>()) // Only match Dirty from prefab
49 .build();
50
51 // Create two prefabs with a Dirty component. We can use this to share a
52 // single Dirty value for all entities in a table.
53 let prefab_dirty_false = world
54 .prefab_named("prefab_dirty_false")
55 .set(Dirty { value: false });
56
57 let prefab_dirty_true = world
58 .prefab_named("prefab_dirty_true")
59 .set(Dirty { value: true });
60
61 // Create instances of p1 and p2. Because the entities have different
62 // prefabs, they end up in different tables.
63 world
64 .entity_named("e1_dirty_false")
65 .is_a(prefab_dirty_false)
66 .set(Position { x: 10.0, y: 20.0 });
67
68 world
69 .entity_named("e2_dirty_false")
70 .is_a(prefab_dirty_false)
71 .set(Position { x: 30.0, y: 40.0 });
72
73 world
74 .entity_named("e3_dirty_true")
75 .is_a(prefab_dirty_true)
76 .set(Position { x: 40.0, y: 50.0 });
77
78 world
79 .entity_named("e4_dirty_true")
80 .is_a(prefab_dirty_true)
81 .set(Position { x: 50.0, y: 60.0 });
82
83 // We can use the changed() function on the query to check if any of the
84 // tables it is matched with has changed. Since this is the first time that
85 // we check this and the query is matched with the tables we just created,
86 // the function will return true.
87 println!();
88 println!("query_read.is_changed(): {}", query_read.is_changed());
89 println!();
90
91 // The changed state will remain true until we have iterated each table.
92 query_read.run(|mut iter| {
93 while iter.next() {
94 // With the it.changed() function we can check if the table we're
95 // currently iterating has changed since last iteration.
96 // Because this is the first time the query is iterated, all tables
97 // will show up as changed.
98 println!(
99 "iiter.is_changed() for table [{}]: {}",
100 iter.archetype().unwrap(),
101 iter.is_changed()
102 );
103 }
104 });
105
106 // Now that we have iterated all tables, the dirty state is reset.
107 println!();
108 println!("query_read.is_changed(): {:?}", query_read.is_changed());
109 println!();
110
111 // Iterate the write query. Because the Position term is InOut (default)
112 // iterating the query will write to the dirty state of iterated tables.
113 query_write.run(|mut it| {
114 while it.next() {
115 let dirty = it.field::<Dirty>(0);
116 let mut pos = it.field_mut::<Position>(1);
117
118 println!("iterate table [{}]", it.archetype().unwrap());
119
120 // Because we enforced that Dirty is a shared component, we can check
121 // a single value for the entire table.
122 if !dirty[0].value {
123 println!("iter.skip() for table [{}]", it.archetype().unwrap());
124
125 // If the dirty flag is false, skip the table. This way the table's
126 // dirty state is not updated by the query.
127 dirty.drop();
128 pos.drop();
129 it.skip();
130
131 continue;
132 }
133
134 // For all other tables the dirty state will be set.
135 for i in it.iter() {
136 pos[i].x += 1.0;
137 pos[i].y += 1.0;
138 }
139 }
140 });
141
142 // One of the tables has changed, so q_read.changed() will return true
143 println!();
144 println!("query_read.is_changed(): {}", query_read.is_changed());
145 println!();
146
147 // When we iterate the read query, we'll see that one table has changed.
148 query_read.run(|mut iter| {
149 while iter.next() {
150 println!(
151 "iter.is_changed() for table [{}]: {}",
152 iter.archetype().unwrap(),
153 iter.is_changed()
154 );
155 }
156 });
157 println!();
158
159 // Output:
160 // query_read.is_changed(): true
161 //
162 // iiter.is_changed() for table [Position, (Identifier,Name), (IsA,prefab_dirty_false)]: true
163 // iiter.is_changed() for table [Position, (Identifier,Name), (IsA,prefab_dirty_true)]: true
164 //
165 // query_read.is_changed(): false
166 //
167 // iterate table [Position, (Identifier,Name), (IsA,prefab_dirty_false)]
168 // iter.skip() for table [Position, (Identifier,Name), (IsA,prefab_dirty_false)]
169 // iterate table [Position, (Identifier,Name), (IsA,prefab_dirty_true)]
170 //
171 // query_read.is_changed(): true
172 //
173 // iter.is_changed() for table [Position, (Identifier,Name), (IsA,prefab_dirty_false)]: false
174 // iter.is_changed() for table [Position, (Identifier,Name), (IsA,prefab_dirty_true)]: true
175}Sourcepub fn group_info(
&self,
group_id: impl Into<Entity>,
) -> *const ecs_query_group_info_t
pub fn group_info( &self, group_id: impl Into<Entity>, ) -> *const ecs_query_group_info_t
Sourcepub fn group_context(&self, group_id: impl Into<Entity>) -> *mut c_void
pub fn group_context(&self, group_id: impl Into<Entity>) -> *mut c_void
Get context for group
ยงArguments
group_id- The group id to get context for
ยงReturns
Returns a (void) pointer to the group context
Examples found in repository?
75fn main() {
76 let world = World::new();
77
78 // Register components in order so that id for First is lower than Third
79 world.component::<First>();
80 world.component::<Second>();
81 world.component::<Third>();
82
83 // Grouped query
84 let query = world
85 .query::<(&Position,)>()
86 .group_by(Group)
87 // Callback invoked when a new group is created
88 .on_group_create(Some(callback_group_create))
89 // Callback invoked when a group is deleted
90 .on_group_delete(Some(callback_group_delete))
91 .build();
92
93 // Create entities in 6 different tables with 3 group ids
94 world
95 .entity()
96 .add((Group, Third))
97 .set(Position { x: 1.0, y: 1.0 });
98 world
99 .entity()
100 .add((Group, Second))
101 .set(Position { x: 2.0, y: 2.0 });
102 world
103 .entity()
104 .add((Group, First))
105 .set(Position { x: 3.0, y: 3.0 });
106
107 world
108 .entity()
109 .add((Group, Third))
110 .set(Position { x: 4.0, y: 4.0 })
111 .add(Tag);
112 world
113 .entity()
114 .add((Group, Second))
115 .set(Position { x: 5.0, y: 5.0 })
116 .add(Tag);
117 world
118 .entity()
119 .add((Group, First))
120 .set(Position { x: 6.0, y: 6.0 })
121 .add(Tag);
122
123 println!();
124
125 // The query cache now looks like this:
126 // - group First:
127 // - table [Position, (Group, First)]
128 // - table [Position, Tag, (Group, First)]
129 //
130 // - group Second:
131 // - table [Position, (Group, Second)]
132 // - table [Position, Tag, (Group, Second)]
133 //
134 // - group Third:
135 // - table [Position, (Group, Third)]
136 // - table [Position, Tag, (Group, Third)]
137 //
138
139 query.run(|mut it| {
140 while it.next() {
141 let group = world.entity_from_id(it.group_id());
142 let pos = it.field::<Position>(0);
143
144 let ctx = unsafe { &*(query.group_context(group) as *mut GroupCtx) };
145 println!(
146 "Group: {:?} - Table: [{:?}] - Counter: {}",
147 group.path().unwrap(),
148 it.archetype(),
149 ctx.counter
150 );
151
152 for i in it.iter() {
153 println!(" [{:?}]", pos[i]);
154 }
155
156 println!();
157 }
158 });
159
160 // Deleting the query will call the on_group_deleted callback
161 query.destruct();
162
163 // Output:
164 // Group created: "Third"
165 // Group created: "Second"
166 // Group created: "First"
167 //
168 // Group: "::First" - Table: [Position, (Group,First)] - Counter: 3
169 // [Position { x: 3.0, y: 3.0 }]
170 //
171 // Group: "::First" - Table: [Position, Tag, (Group,First)] - Counter: 3
172 // [Position { x: 6.0, y: 6.0 }]
173 //
174 // Group: "::Second" - Table: [Position, (Group,Second)] - Counter: 2
175 // [Position { x: 2.0, y: 2.0 }]
176 //
177 // Group: "::Second" - Table: [Position, Tag, (Group,Second)] - Counter: 2
178 // [Position { x: 5.0, y: 5.0 }]
179 //
180 // Group: "::Third" - Table: [Position, (Group,Third)] - Counter: 1
181 // [Position { x: 1.0, y: 1.0 }]
182 //
183 // Group: "::Third" - Table: [Position, Tag, (Group,Third)] - Counter: 1
184 // [Position { x: 4.0, y: 4.0 }]
185 //
186 // Group deleted: "Second"
187 // Group deleted: "First"
188 // Group deleted: "Third"
189}Trait Implementationsยง
impl<T> IterOperations for Query<T>where
T: QueryTuple,
Sourceยงimpl<T> QueryAPI<'_, (), T> for Query<T>where
T: QueryTuple,
impl<T> QueryAPI<'_, (), T> for Query<T>where
T: QueryTuple,
Sourceยงfn entity(&self) -> EntityView<'_>
fn entity(&self) -> EntityView<'_>
Sourceยงfn each(&self, func: impl FnMut(T::TupleType<'_>))
fn each(&self, func: impl FnMut(T::TupleType<'_>))
Sourceยงunsafe fn each_unchecked(&self, func: impl FnMut(T::TupleType<'_>))
unsafe fn each_unchecked(&self, func: impl FnMut(T::TupleType<'_>))
Sourceยงfn each_internal<const CHECKED: bool>(&self, func: impl FnMut(T::TupleType<'_>))
fn each_internal<const CHECKED: bool>(&self, func: impl FnMut(T::TupleType<'_>))
Sourceยงfn each_entity(&self, func: impl FnMut(EntityView<'_>, T::TupleType<'_>))
fn each_entity(&self, func: impl FnMut(EntityView<'_>, T::TupleType<'_>))
Sourceยงunsafe fn each_entity_unchecked(
&self,
func: impl FnMut(EntityView<'_>, T::TupleType<'_>),
)
unsafe fn each_entity_unchecked( &self, func: impl FnMut(EntityView<'_>, T::TupleType<'_>), )
Sourceยงfn each_entity_internal<const CHECKED: bool>(
&self,
func: impl FnMut(EntityView<'_>, T::TupleType<'_>),
)
fn each_entity_internal<const CHECKED: bool>( &self, func: impl FnMut(EntityView<'_>, T::TupleType<'_>), )
each_entity iteration.Sourceยงfn each_iter(
&self,
func: impl FnMut(TableIter<'_, false, P>, FieldIndex, T::TupleType<'_>),
)where
P: ComponentId,
fn each_iter(
&self,
func: impl FnMut(TableIter<'_, false, P>, FieldIndex, T::TupleType<'_>),
)where
P: ComponentId,
Sourceยงunsafe fn each_iter_unchecked(
&self,
func: impl FnMut(TableIter<'_, false, P>, FieldIndex, T::TupleType<'_>),
)where
P: ComponentId,
unsafe fn each_iter_unchecked(
&self,
func: impl FnMut(TableIter<'_, false, P>, FieldIndex, T::TupleType<'_>),
)where
P: ComponentId,
Sourceยงfn each_iter_internal<const CHECKED: bool>(
&self,
func: impl FnMut(TableIter<'_, false, P>, FieldIndex, T::TupleType<'_>),
)where
P: ComponentId,
fn each_iter_internal<const CHECKED: bool>(
&self,
func: impl FnMut(TableIter<'_, false, P>, FieldIndex, T::TupleType<'_>),
)where
P: ComponentId,
each_iter iteration.Sourceยงfn find(
&self,
func: impl FnMut(T::TupleType<'_>) -> bool,
) -> Option<EntityView<'a>>
fn find( &self, func: impl FnMut(T::TupleType<'_>) -> bool, ) -> Option<EntityView<'a>>
Sourceยงfn find_entity(
&self,
func: impl FnMut(EntityView<'_>, T::TupleType<'_>) -> bool,
) -> Option<EntityView<'a>>
fn find_entity( &self, func: impl FnMut(EntityView<'_>, T::TupleType<'_>) -> bool, ) -> Option<EntityView<'a>>
Sourceยงfn run(&self, func: impl FnMut(TableIter<'_, true, P>))where
P: ComponentId,
fn run(&self, func: impl FnMut(TableIter<'_, true, P>))where
P: ComponentId,
Sourceยงfn run_each<FuncEach>(
&self,
func: impl FnMut(TableIter<'_, true, P>),
func_each: FuncEach,
)where
P: ComponentId,
FuncEach: FnMut(T::TupleType<'_>),
fn run_each<FuncEach>(
&self,
func: impl FnMut(TableIter<'_, true, P>),
func_each: FuncEach,
)where
P: ComponentId,
FuncEach: FnMut(T::TupleType<'_>),
Sourceยงfn run_each_entity<FuncEachEntity>(
&self,
func: impl FnMut(TableIter<'_, true, P>),
func_each: FuncEachEntity,
)
fn run_each_entity<FuncEachEntity>( &self, func: impl FnMut(TableIter<'_, true, P>), func_each: FuncEachEntity, )
Sourceยงfn run_each_iter<FuncEachIter>(
&self,
func: impl FnMut(TableIter<'_, true, P>),
func_each: FuncEachIter,
)
fn run_each_iter<FuncEachIter>( &self, func: impl FnMut(TableIter<'_, true, P>), func_each: FuncEachIter, )
Sourceยงfn each_term(&self, func: impl FnMut(&TermRef<'_>))
fn each_term(&self, func: impl FnMut(&TermRef<'_>))
each_term iterator accepts a function that is invoked for each term
in the query. The following function signature is valid: Read moreSourceยงfn term(&self, index: usize) -> TermRef<'_>
fn term(&self, index: usize) -> TermRef<'_>
Sourceยงfn field_count(&self) -> i8
fn field_count(&self) -> i8
Sourceยงfn term_count(&self) -> u32
fn term_count(&self) -> u32
Sourceยงfn to_string(&self) -> String
fn to_string(&self) -> String
fn find_var(&self, name: &str) -> Option<i32>
fn plan(&self) -> String
fn iterable(&self) -> QueryIter<'_, P, T>
fn iter_stage(&'a self, stage: impl WorldProvider<'a>) -> QueryIter<'a, P, T>
Sourceยงfn try_first_entity(&self) -> Option<EntityView<'a>>
fn try_first_entity(&self) -> Option<EntityView<'a>>
Sourceยงfn first_entity(&self) -> EntityView<'a>
fn first_entity(&self) -> EntityView<'a>
Sourceยงfn try_first<R>(&self, func: impl FnOnce(T::TupleType<'_>) -> R) -> Option<R>
fn try_first<R>(&self, func: impl FnOnce(T::TupleType<'_>) -> R) -> Option<R>
Sourceยงfn first<R>(&self, func: impl FnOnce(T::TupleType<'_>) -> R) -> R
fn first<R>(&self, func: impl FnOnce(T::TupleType<'_>) -> R) -> R
Sourceยงfn try_first_only<R>(
&self,
func: impl FnOnce(T::TupleType<'_>) -> R,
) -> Result<R, FirstOnlyError>
fn try_first_only<R>( &self, func: impl FnOnce(T::TupleType<'_>) -> R, ) -> Result<R, FirstOnlyError>
Sourceยงfn first_only<R>(&self, func: impl FnOnce(T::TupleType<'_>) -> R) -> R
fn first_only<R>(&self, func: impl FnOnce(T::TupleType<'_>) -> R) -> R
Sourceยงfn set_group(&self, group_id: impl IntoEntity) -> QueryIter<'_, P, T>
fn set_group(&self, group_id: impl IntoEntity) -> QueryIter<'_, P, T>
Sourceยงfn set_var(&self, var_id: i32, value: impl Into<Entity>) -> QueryIter<'_, P, T>
fn set_var(&self, var_id: i32, value: impl Into<Entity>) -> QueryIter<'_, P, T>
Sourceยงfn set_var_table(
&self,
var_id: i32,
table: impl IntoTableRange,
) -> QueryIter<'_, P, T>
fn set_var_table( &self, var_id: i32, table: impl IntoTableRange, ) -> QueryIter<'_, P, T>
Sourceยงfn set_var_expr(
&self,
name: &str,
value: impl Into<Entity>,
) -> QueryIter<'_, P, T>
fn set_var_expr( &self, name: &str, value: impl Into<Entity>, ) -> QueryIter<'_, P, T>
Sourceยงfn set_var_table_expr(
&self,
name: &str,
table: impl IntoTableRange,
) -> QueryIter<'_, P, T>
fn set_var_table_expr( &self, name: &str, table: impl IntoTableRange, ) -> QueryIter<'_, P, T>
Sourceยงfn to_json(&self, desc: Option<&IterToJsonDesc>) -> Option<String>
fn to_json(&self, desc: Option<&IterToJsonDesc>) -> Option<String>
flecs_json only.fn cache_query(&self) -> Option<Query<()>>
impl<T> Send for Query<T>where
T: QueryTuple,
impl<T> Sync for Query<T>where
T: QueryTuple,
Auto Trait Implementationsยง
impl<T> Freeze for Query<T>where
PhantomData<T>: Freeze,
impl<T> RefUnwindSafe for Query<T>where
PhantomData<T>: RefUnwindSafe,
impl<T> Unpin for Query<T>where
PhantomData<T>: Unpin,
impl<T> UnsafeUnpin for Query<T>where
PhantomData<T>: UnsafeUnpin,
impl<T> UnwindSafe for Query<T>where
PhantomData<T>: UnwindSafe,
Blanket Implementationsยง
impl<T> AccessArg for T
Sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<'a, T> Doc<'a> for T
impl<'a, T> Doc<'a> for T
Sourceยงfn doc_name(&self) -> Option<String>
fn doc_name(&self) -> Option<String>
flecs_doc only.Sourceยงfn doc_brief(&self) -> Option<String>
fn doc_brief(&self) -> Option<String>
flecs_doc only.Sourceยงfn doc_detail(&self) -> Option<String>
fn doc_detail(&self) -> Option<String>
flecs_doc only.Sourceยงfn doc_link(&self) -> Option<String>
fn doc_link(&self) -> Option<String>
flecs_doc only.Sourceยงfn doc_color(&self) -> Option<String>
fn doc_color(&self) -> Option<String>
flecs_doc only.Sourceยงfn doc_uuid(&self) -> Option<String>
fn doc_uuid(&self) -> Option<String>
flecs_doc only.Sourceยงfn set_doc_name(&self, name: &str) -> &Self
fn set_doc_name(&self, name: &str) -> &Self
flecs_doc only.Sourceยงfn set_doc_brief(&self, brief: &str) -> &Self
fn set_doc_brief(&self, brief: &str) -> &Self
flecs_doc only.Sourceยงfn set_doc_detail(&self, detail: &str) -> &Self
fn set_doc_detail(&self, detail: &str) -> &Self
flecs_doc only.Sourceยงfn set_doc_link(&self, link: &str) -> &Self
fn set_doc_link(&self, link: &str) -> &Self
flecs_doc only.Sourceยงfn set_doc_color(&self, color: &str) -> &Self
fn set_doc_color(&self, color: &str) -> &Self
flecs_doc only.Sourceยงfn set_doc_uuid(&self, uuid: &str) -> &Self
fn set_doc_uuid(&self, uuid: &str) -> &Self
flecs_doc only.(flecs.doc.Description, flecs.doc.Uuid) to the entity. Read more