pub struct QueryRef<'w, S> where
    S: QuerySpec
{ /* private fields */ }
Expand description

Borrow of the World for a Query. Required to obtain an iterator.

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);

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.