[][src]Struct hecs::With

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

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

impl<T: Component, Q: Query> Query for With<T, Q>[src]

type Fetch = FetchWith<T, Q::Fetch>

Auto Trait Implementations

impl<T, Q> RefUnwindSafe for With<T, Q> where
    Q: RefUnwindSafe

impl<T, Q> Send for With<T, Q> where
    Q: Send

impl<T, Q> Sync for With<T, Q> where
    Q: Sync

impl<T, Q> Unpin for With<T, Q> where
    Q: Unpin

impl<T, Q> UnwindSafe for With<T, Q> where
    Q: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.