Trait bones_lib::ecs::entities::QueryItem

pub trait QueryItem {
    type Iter: Iterator;

    // Required methods
    fn apply_bitset(&self, bitset: &mut BitSetVec);
    fn get_single_with_bitset(
        self,
        bitset: Rc<BitSetVec>,
    ) -> Result<<Self::Iter as Iterator>::Item, QuerySingleError>;
    fn iter_with_bitset(self, bitset: Rc<BitSetVec>) -> Self::Iter;
}
Expand description

A type representing a component-joining entity query.

Required Associated Types§

type Iter: Iterator

The type of iterator this query item creates

Required Methods§

fn apply_bitset(&self, bitset: &mut BitSetVec)

Modify the iteration bitset

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<Self::Iter as Iterator>::Item, QuerySingleError>

Return the item that matches the query within the given bitset if there is exactly one entity that matches this query item.

fn iter_with_bitset(self, bitset: Rc<BitSetVec>) -> Self::Iter

Return an iterator over the provided bitset.

Implementations on Foreign Types§

§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z> QueryItem for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

§

impl<B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z> QueryItem for (B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

§

impl<C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z> QueryItem for (C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

§

impl<D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z> QueryItem for (D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

§

impl<E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z> QueryItem for (E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

§

impl<F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z> QueryItem for (F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

§

impl<G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z> QueryItem for (G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

§

impl<H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z> QueryItem for (H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

§

impl<I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z> QueryItem for (I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

§

type Iter = MultiQueryIter<(<I as QueryItem>::Iter, <J as QueryItem>::Iter, <K as QueryItem>::Iter, <L as QueryItem>::Iter, <M as QueryItem>::Iter, <N as QueryItem>::Iter, <O as QueryItem>::Iter, <P as QueryItem>::Iter, <Q as QueryItem>::Iter, <R as QueryItem>::Iter, <S as QueryItem>::Iter, <T as QueryItem>::Iter, <U as QueryItem>::Iter, <V as QueryItem>::Iter, <W as QueryItem>::Iter, <X as QueryItem>::Iter, <Y as QueryItem>::Iter, <Z as QueryItem>::Iter)>

§

fn apply_bitset(&self, bitset: &mut BitSetVec)

§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<(I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

§

fn iter_with_bitset( self, bitset: Rc<BitSetVec>, ) -> <(I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter

§

impl<J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z> QueryItem for (J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

§

type Iter = MultiQueryIter<(<J as QueryItem>::Iter, <K as QueryItem>::Iter, <L as QueryItem>::Iter, <M as QueryItem>::Iter, <N as QueryItem>::Iter, <O as QueryItem>::Iter, <P as QueryItem>::Iter, <Q as QueryItem>::Iter, <R as QueryItem>::Iter, <S as QueryItem>::Iter, <T as QueryItem>::Iter, <U as QueryItem>::Iter, <V as QueryItem>::Iter, <W as QueryItem>::Iter, <X as QueryItem>::Iter, <Y as QueryItem>::Iter, <Z as QueryItem>::Iter)>

§

fn apply_bitset(&self, bitset: &mut BitSetVec)

§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<(J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

§

fn iter_with_bitset( self, bitset: Rc<BitSetVec>, ) -> <(J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter

§

impl<K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z> QueryItem for (K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

§

type Iter = MultiQueryIter<(<K as QueryItem>::Iter, <L as QueryItem>::Iter, <M as QueryItem>::Iter, <N as QueryItem>::Iter, <O as QueryItem>::Iter, <P as QueryItem>::Iter, <Q as QueryItem>::Iter, <R as QueryItem>::Iter, <S as QueryItem>::Iter, <T as QueryItem>::Iter, <U as QueryItem>::Iter, <V as QueryItem>::Iter, <W as QueryItem>::Iter, <X as QueryItem>::Iter, <Y as QueryItem>::Iter, <Z as QueryItem>::Iter)>

§

fn apply_bitset(&self, bitset: &mut BitSetVec)

§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<(K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

§

fn iter_with_bitset( self, bitset: Rc<BitSetVec>, ) -> <(K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter

§

impl<L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z> QueryItem for (L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

§

type Iter = MultiQueryIter<(<L as QueryItem>::Iter, <M as QueryItem>::Iter, <N as QueryItem>::Iter, <O as QueryItem>::Iter, <P as QueryItem>::Iter, <Q as QueryItem>::Iter, <R as QueryItem>::Iter, <S as QueryItem>::Iter, <T as QueryItem>::Iter, <U as QueryItem>::Iter, <V as QueryItem>::Iter, <W as QueryItem>::Iter, <X as QueryItem>::Iter, <Y as QueryItem>::Iter, <Z as QueryItem>::Iter)>

§

fn apply_bitset(&self, bitset: &mut BitSetVec)

§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<(L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

§

fn iter_with_bitset( self, bitset: Rc<BitSetVec>, ) -> <(L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter

§

impl<M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z> QueryItem for (M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

§

type Iter = MultiQueryIter<(<M as QueryItem>::Iter, <N as QueryItem>::Iter, <O as QueryItem>::Iter, <P as QueryItem>::Iter, <Q as QueryItem>::Iter, <R as QueryItem>::Iter, <S as QueryItem>::Iter, <T as QueryItem>::Iter, <U as QueryItem>::Iter, <V as QueryItem>::Iter, <W as QueryItem>::Iter, <X as QueryItem>::Iter, <Y as QueryItem>::Iter, <Z as QueryItem>::Iter)>

§

fn apply_bitset(&self, bitset: &mut BitSetVec)

§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<(M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

§

fn iter_with_bitset( self, bitset: Rc<BitSetVec>, ) -> <(M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter

§

impl<N, O, P, Q, R, S, T, U, V, W, X, Y, Z> QueryItem for (N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

§

type Iter = MultiQueryIter<(<N as QueryItem>::Iter, <O as QueryItem>::Iter, <P as QueryItem>::Iter, <Q as QueryItem>::Iter, <R as QueryItem>::Iter, <S as QueryItem>::Iter, <T as QueryItem>::Iter, <U as QueryItem>::Iter, <V as QueryItem>::Iter, <W as QueryItem>::Iter, <X as QueryItem>::Iter, <Y as QueryItem>::Iter, <Z as QueryItem>::Iter)>

§

fn apply_bitset(&self, bitset: &mut BitSetVec)

§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<(N, O, P, Q, R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

§

fn iter_with_bitset( self, bitset: Rc<BitSetVec>, ) -> <(N, O, P, Q, R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter

§

impl<O, P, Q, R, S, T, U, V, W, X, Y, Z> QueryItem for (O, P, Q, R, S, T, U, V, W, X, Y, Z)

§

type Iter = MultiQueryIter<(<O as QueryItem>::Iter, <P as QueryItem>::Iter, <Q as QueryItem>::Iter, <R as QueryItem>::Iter, <S as QueryItem>::Iter, <T as QueryItem>::Iter, <U as QueryItem>::Iter, <V as QueryItem>::Iter, <W as QueryItem>::Iter, <X as QueryItem>::Iter, <Y as QueryItem>::Iter, <Z as QueryItem>::Iter)>

§

fn apply_bitset(&self, bitset: &mut BitSetVec)

§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<(O, P, Q, R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

§

fn iter_with_bitset( self, bitset: Rc<BitSetVec>, ) -> <(O, P, Q, R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter

§

impl<P, Q, R, S, T, U, V, W, X, Y, Z> QueryItem for (P, Q, R, S, T, U, V, W, X, Y, Z)

§

type Iter = MultiQueryIter<(<P as QueryItem>::Iter, <Q as QueryItem>::Iter, <R as QueryItem>::Iter, <S as QueryItem>::Iter, <T as QueryItem>::Iter, <U as QueryItem>::Iter, <V as QueryItem>::Iter, <W as QueryItem>::Iter, <X as QueryItem>::Iter, <Y as QueryItem>::Iter, <Z as QueryItem>::Iter)>

§

fn apply_bitset(&self, bitset: &mut BitSetVec)

§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<(P, Q, R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

§

fn iter_with_bitset( self, bitset: Rc<BitSetVec>, ) -> <(P, Q, R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter

§

impl<Q, R, S, T, U, V, W, X, Y, Z> QueryItem for (Q, R, S, T, U, V, W, X, Y, Z)

§

type Iter = MultiQueryIter<(<Q as QueryItem>::Iter, <R as QueryItem>::Iter, <S as QueryItem>::Iter, <T as QueryItem>::Iter, <U as QueryItem>::Iter, <V as QueryItem>::Iter, <W as QueryItem>::Iter, <X as QueryItem>::Iter, <Y as QueryItem>::Iter, <Z as QueryItem>::Iter)>

§

fn apply_bitset(&self, bitset: &mut BitSetVec)

§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<(Q, R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

§

fn iter_with_bitset( self, bitset: Rc<BitSetVec>, ) -> <(Q, R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter

§

impl<R, S, T, U, V, W, X, Y, Z> QueryItem for (R, S, T, U, V, W, X, Y, Z)

§

type Iter = MultiQueryIter<(<R as QueryItem>::Iter, <S as QueryItem>::Iter, <T as QueryItem>::Iter, <U as QueryItem>::Iter, <V as QueryItem>::Iter, <W as QueryItem>::Iter, <X as QueryItem>::Iter, <Y as QueryItem>::Iter, <Z as QueryItem>::Iter)>

§

fn apply_bitset(&self, bitset: &mut BitSetVec)

§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<(R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

§

fn iter_with_bitset( self, bitset: Rc<BitSetVec>, ) -> <(R, S, T, U, V, W, X, Y, Z) as QueryItem>::Iter

§

impl<S, T, U, V, W, X, Y, Z> QueryItem for (S, T, U, V, W, X, Y, Z)

§

type Iter = MultiQueryIter<(<S as QueryItem>::Iter, <T as QueryItem>::Iter, <U as QueryItem>::Iter, <V as QueryItem>::Iter, <W as QueryItem>::Iter, <X as QueryItem>::Iter, <Y as QueryItem>::Iter, <Z as QueryItem>::Iter)>

§

fn apply_bitset(&self, bitset: &mut BitSetVec)

§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<(S, T, U, V, W, X, Y, Z) as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

§

fn iter_with_bitset( self, bitset: Rc<BitSetVec>, ) -> <(S, T, U, V, W, X, Y, Z) as QueryItem>::Iter

§

impl<T, U, V, W, X, Y, Z> QueryItem for (T, U, V, W, X, Y, Z)

§

type Iter = MultiQueryIter<(<T as QueryItem>::Iter, <U as QueryItem>::Iter, <V as QueryItem>::Iter, <W as QueryItem>::Iter, <X as QueryItem>::Iter, <Y as QueryItem>::Iter, <Z as QueryItem>::Iter)>

§

fn apply_bitset(&self, bitset: &mut BitSetVec)

§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<(T, U, V, W, X, Y, Z) as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

§

fn iter_with_bitset( self, bitset: Rc<BitSetVec>, ) -> <(T, U, V, W, X, Y, Z) as QueryItem>::Iter

§

impl<U, V, W, X, Y, Z> QueryItem for (U, V, W, X, Y, Z)

§

type Iter = MultiQueryIter<(<U as QueryItem>::Iter, <V as QueryItem>::Iter, <W as QueryItem>::Iter, <X as QueryItem>::Iter, <Y as QueryItem>::Iter, <Z as QueryItem>::Iter)>

§

fn apply_bitset(&self, bitset: &mut BitSetVec)

§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<(U, V, W, X, Y, Z) as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

§

fn iter_with_bitset( self, bitset: Rc<BitSetVec>, ) -> <(U, V, W, X, Y, Z) as QueryItem>::Iter

§

impl<V, W, X, Y, Z> QueryItem for (V, W, X, Y, Z)
where V: QueryItem, W: QueryItem, X: QueryItem, Y: QueryItem, Z: QueryItem,

§

type Iter = MultiQueryIter<(<V as QueryItem>::Iter, <W as QueryItem>::Iter, <X as QueryItem>::Iter, <Y as QueryItem>::Iter, <Z as QueryItem>::Iter)>

§

fn apply_bitset(&self, bitset: &mut BitSetVec)

§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<(V, W, X, Y, Z) as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

§

fn iter_with_bitset( self, bitset: Rc<BitSetVec>, ) -> <(V, W, X, Y, Z) as QueryItem>::Iter

§

impl<W, X, Y, Z> QueryItem for (W, X, Y, Z)
where W: QueryItem, X: QueryItem, Y: QueryItem, Z: QueryItem,

§

type Iter = MultiQueryIter<(<W as QueryItem>::Iter, <X as QueryItem>::Iter, <Y as QueryItem>::Iter, <Z as QueryItem>::Iter)>

§

fn apply_bitset(&self, bitset: &mut BitSetVec)

§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<(W, X, Y, Z) as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

§

fn iter_with_bitset( self, bitset: Rc<BitSetVec>, ) -> <(W, X, Y, Z) as QueryItem>::Iter

§

impl<X, Y, Z> QueryItem for (X, Y, Z)
where X: QueryItem, Y: QueryItem, Z: QueryItem,

§

type Iter = MultiQueryIter<(<X as QueryItem>::Iter, <Y as QueryItem>::Iter, <Z as QueryItem>::Iter)>

§

fn apply_bitset(&self, bitset: &mut BitSetVec)

§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<(X, Y, Z) as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

§

fn iter_with_bitset( self, bitset: Rc<BitSetVec>, ) -> <(X, Y, Z) as QueryItem>::Iter

§

impl<Y, Z> QueryItem for (Y, Z)
where Y: QueryItem, Z: QueryItem,

§

type Iter = MultiQueryIter<(<Y as QueryItem>::Iter, <Z as QueryItem>::Iter)>

§

fn apply_bitset(&self, bitset: &mut BitSetVec)

§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<(Y, Z) as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

§

fn iter_with_bitset(self, bitset: Rc<BitSetVec>) -> <(Y, Z) as QueryItem>::Iter

§

impl<Z> QueryItem for (Z,)
where Z: QueryItem,

§

type Iter = MultiQueryIter<(<Z as QueryItem>::Iter,)>

§

fn apply_bitset(&self, bitset: &mut BitSetVec)

§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<(Z,) as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

§

fn iter_with_bitset(self, bitset: Rc<BitSetVec>) -> <(Z,) as QueryItem>::Iter

Implementors§

§

impl<'a> QueryItem for &'a Ref<'a, UntypedComponentStore>

§

impl<'a, 'q, T> QueryItem for &'a Ref<'q, ComponentStore<T>>
where T: HasSchema,

§

type Iter = Map<UntypedComponentBitsetIterator<'a>, for<'b> fn(_: SchemaRef<'b>) -> &'b T>

§

impl<'a, 'q, T> QueryItem for &'a RefMut<'q, ComponentStore<T>>
where T: HasSchema,

§

type Iter = Map<UntypedComponentBitsetIterator<'a>, for<'b> fn(_: SchemaRef<'b>) -> &'b T>

§

impl<'a, 'q, T> QueryItem for &'a mut RefMut<'q, ComponentStore<T>>
where T: HasSchema,

§

impl<'a, T, S, C> QueryItem for &'a OptionalQueryItem<'a, T, S>
where T: HasSchema, C: ComponentIterBitset<'a, T> + 'a, S: Deref<Target = C> + 'a,

Immutably iterate over optional component with syntax: &Optional(&Comp<T>) / &Optional(&CompMut<T>). (For mutable optional iteration we require &mut OptionalMut(&mut CompMut<T>))

§

impl<'a, T, S, C> QueryItem for &'a mut OptionalQueryItemMut<'a, T, S>
where T: HasSchema, C: ComponentIterBitset<'a, T> + 'a, S: DerefMut<Target = C> + 'a,

Mutably iterate over optional component with syntax: &mut OptionalMut(&mut RefMut<ComponentStore<T>>)