#How does Query work?

11 messages · Page 1 of 1 (latest)

pine wren
#

2 is true

#

The WorldQuery trait defines which data is needed from the world

#

This is implemented for tuples via a macro that emulates variadic generics up to size 16

#

The associated Item type (well, conceptually) on the World Query trait defines the type of the data that's actually returned by the query iterator

#

Ah yes! It's doing "destructuring"

#

This is a very broadly powerful tool in Rust

#

This is only the tuple form

#

You can use it for enums, structs and much more

#

You can use .. to partially destructure 🙂

#

On either the left or the right iirc

#

You might also like the WorldQuery derive, which lets you name the fields