Trait bones_lib::ecs::prelude::QueryItem

source ·
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§

source

type Iter: Iterator

The type of iterator this query item creates

Required Methods§

source

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

Modify the iteration bitset

source

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.

source

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

Return an iterator over the provided bitset.

Implementations on Foreign Types§

source§

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)

source§

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)

source§

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)

source§

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)

source§

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)

source§

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)

source§

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)

source§

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)

source§

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)

source§

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)

source§

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)

source§

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)

source§

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)

source§

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)

source§

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)

source§

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

source§

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

source§

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>

source§

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

source§

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

source§

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

source§

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>

source§

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

source§

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

source§

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

source§

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>

source§

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

source§

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

source§

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

source§

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>

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

§

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

source§

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

source§

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

source§

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

source§

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

§

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

source§

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

source§

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

source§

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

Implementors§

source§

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

source§

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>

source§

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>

source§

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

source§

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

source§

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