pub struct QueryRef<'w, S> where
S: QuerySpec, { /* private fields */ }
Implementations
Visit all entities matching the query.
Create an iterator over the entities matching the query.
Create a parallel iterator over the entities matching the query.
Create a map of the entities matching the query.
This is an alternative to get and get_mut for repeated calls, to amortize the set-up costs.
Examples
let mut world = World::new();
let entity = world.alloc();
world.insert(entity, (42_i32, 1.0_f32));
let mut query = Query::<(&i32, &f32)>::new();
let mut query = query.borrow(&world);
let mut query = query.map();
let (i, f) = query.get_mut(entity).unwrap();
assert_eq!(*i, 42);
assert_eq!(*f, 1.0);