Struct rs_ecs::QueryRef [−][src]
pub struct QueryRef<'w, S> where
S: QuerySpec, { /* fields omitted */ }
Implementations
Create an 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(entity).unwrap(); assert_eq!(*i, 42); assert_eq!(*f, 1.0);
Trait Implementations
Auto Trait Implementations
impl<'w, S> !RefUnwindSafe for QueryRef<'w, S>
impl<'w, S> !UnwindSafe for QueryRef<'w, S>