Skip to main content

QueryInternal

Trait QueryInternal 

Source
pub trait QueryInternal<E: Entity>: 'static {
    type QueryParts<'a>: AsRef<[&'a dyn Any]>
       where Self: 'a;

    // Required methods
    fn get_type_ids(&self) -> Vec<TypeId>;
    fn query_parts(&self) -> Self::QueryParts<'_>;
    fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>;
    fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool;
    fn filter_entities(
        &self,
        entities: &mut Vec<EntityId<E>>,
        context: &Context,
    );

    // Provided methods
    fn resolve_index_property_id(&self, type_ids: &[TypeId]) -> Option<usize> { ... }
    fn resolved_query(&self) -> ResolvedQuery
       where Self: Sized { ... }
    fn multi_property_id(&self) -> Option<usize>
       where Self: Sized { ... }
    fn is_empty_query(&self) -> bool { ... }
    fn new_query_result_iterator<'c>(
        &self,
        context: &'c Context,
    ) -> EntitySetIterator<'c, E> ⓘ { ... }
}
Expand description

Internal query machinery.

Required Associated Types§

Source

type QueryParts<'a>: AsRef<[&'a dyn Any]> where Self: 'a

Allocation-free representation of the query parts exposed by this query.

Required Methods§

Source

fn get_type_ids(&self) -> Vec<TypeId>

Returns an unordered list of registered logical property type IDs for this query.

Source

fn query_parts(&self) -> Self::QueryParts<'_>

Exposes the query parts without allocating.

Source

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Creates a new query result as an EntitySet.

Source

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Determines if the given person matches this query.

Source

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Removes all EntityIds from the given vector that do not match this query.

Provided Methods§

Source

fn resolve_index_property_id(&self, type_ids: &[TypeId]) -> Option<usize>

Resolves the index property for an already sorted query shape without consulting the concrete-query cache.

Source

fn resolved_query(&self) -> ResolvedQuery
where Self: Sized,

Returns the cached index and profiling resolution for this query shape.

Source

fn multi_property_id(&self) -> Option<usize>
where Self: Sized,

Returns the property ID of the representative multi-property having the properties of this query, if any.

Source

fn is_empty_query(&self) -> bool

Indicates whether this query matches the entire population for E.

Source

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Creates a new EntitySetIterator.

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.

Implementations on Foreign Types§

Source§

impl<E: Entity> QueryInternal<E> for ()

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 0] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn resolved_query(&self) -> ResolvedQuery

Source§

fn is_empty_query(&self) -> bool

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, _entity_id: EntityId<E>, _context: &Context) -> bool

Source§

fn filter_entities(&self, _entities: &mut Vec<EntityId<E>>, _context: &Context)

Source§

impl<E: Entity, P1: Property<E>> QueryInternal<E> for (P1,)

Source§

type QueryParts<'a> = <P1 as Property<E>>::QueryParts<'a> where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn resolved_query(&self) -> ResolvedQuery

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Source§

impl<E: Entity, T0: Property<E>, T1: Property<E>> QueryInternal<E> for (T0, T1)

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 2] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Source§

impl<E: Entity, T0: Property<E>, T1: Property<E>, T2: Property<E>> QueryInternal<E> for (T0, T1, T2)

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 3] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Source§

impl<E: Entity, T0: Property<E>, T1: Property<E>, T2: Property<E>, T3: Property<E>> QueryInternal<E> for (T0, T1, T2, T3)

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 4] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Source§

impl<E: Entity, T0: Property<E>, T1: Property<E>, T2: Property<E>, T3: Property<E>, T4: Property<E>> QueryInternal<E> for (T0, T1, T2, T3, T4)

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 5] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Source§

impl<E: Entity, T0: Property<E>, T1: Property<E>, T2: Property<E>, T3: Property<E>, T4: Property<E>, T5: Property<E>> QueryInternal<E> for (T0, T1, T2, T3, T4, T5)

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 6] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Source§

impl<E: Entity, T0: Property<E>, T1: Property<E>, T2: Property<E>, T3: Property<E>, T4: Property<E>, T5: Property<E>, T6: Property<E>> QueryInternal<E> for (T0, T1, T2, T3, T4, T5, T6)

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 7] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Source§

impl<E: Entity, T0: Property<E>, T1: Property<E>, T2: Property<E>, T3: Property<E>, T4: Property<E>, T5: Property<E>, T6: Property<E>, T7: Property<E>> QueryInternal<E> for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 8] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Source§

impl<E: Entity, T0: Property<E>, T1: Property<E>, T2: Property<E>, T3: Property<E>, T4: Property<E>, T5: Property<E>, T6: Property<E>, T7: Property<E>, T8: Property<E>> QueryInternal<E> for (T0, T1, T2, T3, T4, T5, T6, T7, T8)

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 9] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Source§

impl<E: Entity, T0: Property<E>, T1: Property<E>, T2: Property<E>, T3: Property<E>, T4: Property<E>, T5: Property<E>, T6: Property<E>, T7: Property<E>, T8: Property<E>, T9: Property<E>> QueryInternal<E> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 10] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Source§

impl<E: Entity, T0: Property<E>, T1: Property<E>, T2: Property<E>, T3: Property<E>, T4: Property<E>, T5: Property<E>, T6: Property<E>, T7: Property<E>, T8: Property<E>, T9: Property<E>, T10: Property<E>> QueryInternal<E> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 11] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Source§

impl<E: Entity, T0: Property<E>, T1: Property<E>, T2: Property<E>, T3: Property<E>, T4: Property<E>, T5: Property<E>, T6: Property<E>, T7: Property<E>, T8: Property<E>, T9: Property<E>, T10: Property<E>, T11: Property<E>> QueryInternal<E> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 12] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Source§

impl<E: Entity, T0: Property<E>, T1: Property<E>, T2: Property<E>, T3: Property<E>, T4: Property<E>, T5: Property<E>, T6: Property<E>, T7: Property<E>, T8: Property<E>, T9: Property<E>, T10: Property<E>, T11: Property<E>, T12: Property<E>> QueryInternal<E> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 13] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Source§

impl<E: Entity, T0: Property<E>, T1: Property<E>, T2: Property<E>, T3: Property<E>, T4: Property<E>, T5: Property<E>, T6: Property<E>, T7: Property<E>, T8: Property<E>, T9: Property<E>, T10: Property<E>, T11: Property<E>, T12: Property<E>, T13: Property<E>> QueryInternal<E> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 14] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Source§

impl<E: Entity, T0: Property<E>, T1: Property<E>, T2: Property<E>, T3: Property<E>, T4: Property<E>, T5: Property<E>, T6: Property<E>, T7: Property<E>, T8: Property<E>, T9: Property<E>, T10: Property<E>, T11: Property<E>, T12: Property<E>, T13: Property<E>, T14: Property<E>> QueryInternal<E> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 15] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Source§

impl<E: Entity, T0: Property<E>, T1: Property<E>, T2: Property<E>, T3: Property<E>, T4: Property<E>, T5: Property<E>, T6: Property<E>, T7: Property<E>, T8: Property<E>, T9: Property<E>, T10: Property<E>, T11: Property<E>, T12: Property<E>, T13: Property<E>, T14: Property<E>, T15: Property<E>> QueryInternal<E> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 16] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Source§

impl<E: Entity, T0: Property<E>, T1: Property<E>, T2: Property<E>, T3: Property<E>, T4: Property<E>, T5: Property<E>, T6: Property<E>, T7: Property<E>, T8: Property<E>, T9: Property<E>, T10: Property<E>, T11: Property<E>, T12: Property<E>, T13: Property<E>, T14: Property<E>, T15: Property<E>, T16: Property<E>> QueryInternal<E> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 17] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Source§

impl<E: Entity, T0: Property<E>, T1: Property<E>, T2: Property<E>, T3: Property<E>, T4: Property<E>, T5: Property<E>, T6: Property<E>, T7: Property<E>, T8: Property<E>, T9: Property<E>, T10: Property<E>, T11: Property<E>, T12: Property<E>, T13: Property<E>, T14: Property<E>, T15: Property<E>, T16: Property<E>, T17: Property<E>> QueryInternal<E> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17)

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 18] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Source§

impl<E: Entity, T0: Property<E>, T1: Property<E>, T2: Property<E>, T3: Property<E>, T4: Property<E>, T5: Property<E>, T6: Property<E>, T7: Property<E>, T8: Property<E>, T9: Property<E>, T10: Property<E>, T11: Property<E>, T12: Property<E>, T13: Property<E>, T14: Property<E>, T15: Property<E>, T16: Property<E>, T17: Property<E>, T18: Property<E>> QueryInternal<E> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18)

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 19] where Self: 'a

Source§

fn get_type_ids(&self) -> Vec<TypeId>

Source§

fn query_parts(&self) -> Self::QueryParts<'_>

Source§

fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>

Source§

fn new_query_result_iterator<'c>( &self, context: &'c Context, ) -> EntitySetIterator<'c, E> ⓘ

Source§

fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool

Source§

fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)

Implementors§

Source§

impl<E: Entity> QueryInternal<E> for E

Source§

type QueryParts<'a> = [&'a (dyn Any + 'static); 0] where Self: 'a

Source§

impl<E: Entity, T: QueryInternal<E>> QueryInternal<E> for EntityPropertyTuple<E, T>

Source§

type QueryParts<'a> = <T as QueryInternal<E>>::QueryParts<'a> where Self: 'a