pub trait Query: Query {
type Item<'world>;
}Expand description
Query signature: one access type or a tuple of one to eight access types.
Each Entity counts as an entry. Filter clauses have their own separate
four-clause group bound; see QueryFilter. See Bundle for an actor system.
Eight entries, including an entity identity and optional components:
use ferravex_ecs::{Entity, Error, World};
let mut world = World::new();
let entity = world.spawn((1_u8, 2_u16, 3_u32, 4_u64, 5_i8, 6_i16, 7_i32, 8_i64));
let [(id, mut a, b, c, d, e, f, absent)] = world.get_many::<(
Entity, &mut u8, &u16, &u32, &u64, &i8, &i16, Option<&bool>,
), 1>([entity])?;
*a += 1;
assert_eq!(id, entity);
assert_eq!((*a, *b, *c, *d, *e, *f), (2, 2, 3, 4, 5, 6));
assert!(absent.is_none());Entity plus eight component accesses exceeds the fetched tuple ceiling:
ⓘ
use ferravex_ecs::{Entity, World};
World::new().query::<(Entity, &u8, &u16, &u32, &u64, &i8, &i16, &i32, &i64)>();Required Associated Types§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.