@@ -136,6 +136,55 @@ impl SystemMeta {
136
136
{
137
137
self . param_warn_policy . try_warn :: < P > ( & self . name ) ;
138
138
}
139
+
140
+ /// Archetype component access that is used to determine which systems can run in parallel with each other
141
+ /// in the multithreaded executor.
142
+ ///
143
+ /// We use an [`ArchetypeComponentId`] as it is more precise than just checking [`ComponentId`]:
144
+ /// for example if you have one system with `Query<&mut A, With<B>`, and one system with `Query<&mut A, Without<B>`,
145
+ /// they conflict if you just look at the [`ComponentId`];
146
+ /// but no archetype that matches the first query will match the second and vice versa,
147
+ /// which means there's no risk of conflict.
148
+ #[ inline]
149
+ pub fn archetype_component_access ( & self ) -> & Access < ArchetypeComponentId > {
150
+ & self . archetype_component_access
151
+ }
152
+
153
+ /// Returns a mutable reference to the [`Access`] for [`ArchetypeComponentId`].
154
+ /// This is used to determine which systems can run in parallel with each other
155
+ /// in the multithreaded executor.
156
+ ///
157
+ /// We use an [`ArchetypeComponentId`] as it is more precise than just checking [`ComponentId`]:
158
+ /// for example if you have one system with `Query<&mut A, With<B>`, and one system with `Query<&mut A, Without<B>`,
159
+ /// they conflict if you just look at the [`ComponentId`];
160
+ /// but no archetype that matches the first query will match the second and vice versa,
161
+ /// which means there's no risk of conflict.
162
+ ///
163
+ /// # Safety
164
+ ///
165
+ /// No access can be removed from the returned [`Access`].
166
+ #[ inline]
167
+ pub unsafe fn archetype_component_access_mut ( & mut self ) -> & mut Access < ArchetypeComponentId > {
168
+ & mut self . archetype_component_access
169
+ }
170
+
171
+ /// Returns a reference to the [`FilteredAccessSet`] for [`ComponentId`].
172
+ /// Used to check if systems and/or system params have conflicting access.
173
+ #[ inline]
174
+ pub fn component_access_set ( & self ) -> & FilteredAccessSet < ComponentId > {
175
+ & self . component_access_set
176
+ }
177
+
178
+ /// Returns a mutable reference to the [`FilteredAccessSet`] for [`ComponentId`].
179
+ /// Used internally to statically check if systems have conflicting access.
180
+ ///
181
+ /// # Safety
182
+ ///
183
+ /// No access can be removed from the returned [`FilteredAccessSet`].
184
+ #[ inline]
185
+ pub unsafe fn component_access_set_mut ( & mut self ) -> & mut FilteredAccessSet < ComponentId > {
186
+ & mut self . component_access_set
187
+ }
139
188
}
140
189
141
190
/// State machine for emitting warnings when [system params are invalid](System::validate_param).
0 commit comments