@@ -152,6 +152,30 @@ fn impl_trait_query(arg: TokenStream, item: TokenStream) -> Result<TokenStream2>
152
152
#where_clause
153
153
{
154
154
type ReadOnly = Self ;
155
+
156
+ const IS_READ_ONLY : bool = true ;
157
+
158
+ type Item <' __w> = #my_crate:: ReadTraits <' __w, #trait_object>;
159
+
160
+ #[ inline]
161
+ fn shrink<' wlong: ' wshort, ' wshort>(
162
+ item: Self :: Item <' wlong>,
163
+ ) -> Self :: Item <' wshort> {
164
+ item
165
+ }
166
+
167
+ #[ inline]
168
+ unsafe fn fetch<' w>(
169
+ fetch: & mut Self :: Fetch <' w>,
170
+ entity: #imports:: Entity ,
171
+ table_row: #imports:: TableRow ,
172
+ ) -> Self :: Item <' w> {
173
+ <#my_crate:: All <& #trait_object> as #imports:: QueryData >:: fetch(
174
+ fetch,
175
+ entity,
176
+ table_row,
177
+ )
178
+ }
155
179
}
156
180
unsafe impl #impl_generics #imports:: ReadOnlyQueryData for & #trait_object
157
181
#where_clause
@@ -160,7 +184,6 @@ fn impl_trait_query(arg: TokenStream, item: TokenStream) -> Result<TokenStream2>
160
184
unsafe impl #impl_generics_with_lifetime #imports:: WorldQuery for & ' __a #trait_object
161
185
#where_clause
162
186
{
163
- type Item <' __w> = #my_crate:: ReadTraits <' __w, #trait_object>;
164
187
type Fetch <' __w> = <#my_crate:: All <& ' __a #trait_object> as #imports:: WorldQuery >:: Fetch <' __w>;
165
188
type State = #my_crate:: TraitQueryState <#trait_object>;
166
189
@@ -179,13 +202,6 @@ fn impl_trait_query(arg: TokenStream, item: TokenStream) -> Result<TokenStream2>
179
202
)
180
203
}
181
204
182
- #[ inline]
183
- fn shrink<' wlong: ' wshort, ' wshort>(
184
- item: Self :: Item <' wlong>,
185
- ) -> Self :: Item <' wshort> {
186
- item
187
- }
188
-
189
205
const IS_DENSE : bool = <#my_crate:: All <& #trait_object> as #imports:: WorldQuery >:: IS_DENSE ;
190
206
191
207
#[ inline]
@@ -209,19 +225,6 @@ fn impl_trait_query(arg: TokenStream, item: TokenStream) -> Result<TokenStream2>
209
225
<#my_crate:: All <& #trait_object> as #imports:: WorldQuery >:: set_table( fetch, state, table) ;
210
226
}
211
227
212
- #[ inline]
213
- unsafe fn fetch<' w>(
214
- fetch: & mut Self :: Fetch <' w>,
215
- entity: #imports:: Entity ,
216
- table_row: #imports:: TableRow ,
217
- ) -> Self :: Item <' w> {
218
- <#my_crate:: All <& #trait_object> as #imports:: WorldQuery >:: fetch(
219
- fetch,
220
- entity,
221
- table_row,
222
- )
223
- }
224
-
225
228
#[ inline]
226
229
fn update_component_access(
227
230
state: & Self :: State ,
@@ -261,12 +264,35 @@ fn impl_trait_query(arg: TokenStream, item: TokenStream) -> Result<TokenStream2>
261
264
#where_clause
262
265
{
263
266
type ReadOnly = & ' __a #trait_object;
267
+
268
+ type Item <' __w> = #my_crate:: WriteTraits <' __w, #trait_object>;
269
+
270
+ const IS_READ_ONLY : bool = false ;
271
+
272
+ #[ inline]
273
+ fn shrink<' wlong: ' wshort, ' wshort>(
274
+ item: Self :: Item <' wlong>,
275
+ ) -> Self :: Item <' wshort> {
276
+ item
277
+ }
278
+
279
+ #[ inline]
280
+ unsafe fn fetch<' w>(
281
+ fetch: & mut Self :: Fetch <' w>,
282
+ entity: #imports:: Entity ,
283
+ table_row: #imports:: TableRow ,
284
+ ) -> Self :: Item <' w> {
285
+ <#my_crate:: All <& mut #trait_object> as #imports:: QueryData >:: fetch(
286
+ fetch,
287
+ entity,
288
+ table_row,
289
+ )
290
+ }
264
291
}
265
292
266
293
unsafe impl #impl_generics_with_lifetime #imports:: WorldQuery for & ' __a mut #trait_object
267
294
#where_clause
268
295
{
269
- type Item <' __w> = #my_crate:: WriteTraits <' __w, #trait_object>;
270
296
type Fetch <' __w> = <#my_crate:: All <& ' __a #trait_object> as #imports:: WorldQuery >:: Fetch <' __w>;
271
297
type State = #my_crate:: TraitQueryState <#trait_object>;
272
298
@@ -285,13 +311,6 @@ fn impl_trait_query(arg: TokenStream, item: TokenStream) -> Result<TokenStream2>
285
311
)
286
312
}
287
313
288
- #[ inline]
289
- fn shrink<' wlong: ' wshort, ' wshort>(
290
- item: Self :: Item <' wlong>,
291
- ) -> Self :: Item <' wshort> {
292
- item
293
- }
294
-
295
314
const IS_DENSE : bool = <#my_crate:: All <& mut #trait_object> as #imports:: WorldQuery >:: IS_DENSE ;
296
315
297
316
#[ inline]
@@ -315,19 +334,6 @@ fn impl_trait_query(arg: TokenStream, item: TokenStream) -> Result<TokenStream2>
315
334
<#my_crate:: All <& mut #trait_object> as #imports:: WorldQuery >:: set_table( fetch, state, table) ;
316
335
}
317
336
318
- #[ inline]
319
- unsafe fn fetch<' w>(
320
- fetch: & mut Self :: Fetch <' w>,
321
- entity: #imports:: Entity ,
322
- table_row: #imports:: TableRow ,
323
- ) -> Self :: Item <' w> {
324
- <#my_crate:: All <& mut #trait_object> as #imports:: WorldQuery >:: fetch(
325
- fetch,
326
- entity,
327
- table_row,
328
- )
329
- }
330
-
331
337
#[ inline]
332
338
fn update_component_access(
333
339
state: & Self :: State ,
0 commit comments