Struct oxygengine_core::ecs::With[][src]

pub struct With<T, Q>(_);
Expand description

Query transformer skipping entities that do not have a T component

See also QueryBorrow::with.

Example

let mut world = World::new();
let a = world.spawn((123, true, "abc"));
let b = world.spawn((456, false));
let c = world.spawn((42, "def"));
let entities = world.query::<With<bool, &i32>>()
    .iter()
    .map(|(e, &i)| (e, i))
    .collect::<Vec<_>>();
assert_eq!(entities.len(), 2);
assert!(entities.contains(&(a, 123)));
assert!(entities.contains(&(b, 456)));

Trait Implementations

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 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.