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 multi_property_id(&self) -> Option<usize> { ... }
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§
Sourcetype QueryParts<'a>: AsRef<[&'a dyn Any]>
where
Self: 'a
type QueryParts<'a>: AsRef<[&'a dyn Any]> where Self: 'a
Allocation-free representation of the query parts exposed by this query.
Required Methods§
Sourcefn get_type_ids(&self) -> Vec<TypeId>
fn get_type_ids(&self) -> Vec<TypeId>
Returns an unordered list of type IDs of the properties in this query.
Sourcefn query_parts(&self) -> Self::QueryParts<'_>
fn query_parts(&self) -> Self::QueryParts<'_>
Exposes the query parts without allocating.
Sourcefn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>
fn new_query_result<'c>(&self, context: &'c Context) -> EntitySet<'c, E>
Creates a new query result as an EntitySet.
Sourcefn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool
fn match_entity(&self, entity_id: EntityId<E>, context: &Context) -> bool
Determines if the given person matches this query.
Sourcefn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)
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§
Sourcefn multi_property_id(&self) -> Option<usize>
fn multi_property_id(&self) -> Option<usize>
Returns the TypeId of the multi-property having the properties of this query, if any.
Sourcefn is_empty_query(&self) -> bool
fn is_empty_query(&self) -> bool
Indicates whether this query matches the entire population for E.
Sourcefn new_query_result_iterator<'c>(
&self,
context: &'c Context,
) -> EntitySetIterator<'c, E> ⓘ
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.