pub struct EntityPropertyTuple<E: Entity, T> { /* private fields */ }Expand description
A newtype wrapper that associates a tuple of property values with an entity type.
This is not meant to be used directly, but rather as a backing for the with! macro/ a replacement for the query tuple.
§Example
ⓘ
use ixa::{define_entity, define_property, with};
define_entity!(Person);
define_property!(struct Age(u8), Person, default_const = Age(0));
// Build a query for people with Age(42).
let query = with!(Person, Age(42));Implementations§
Trait Implementations§
Source§impl<E: Entity, T: PropertyList<E>> PropertyList<E> for EntityPropertyTuple<E, T>
impl<E: Entity, T: PropertyList<E>> PropertyList<E> for EntityPropertyTuple<E, T>
Source§fn validate() -> Result<(), IxaError>
fn validate() -> Result<(), IxaError>
Validates that the properties are distinct. If not, returns an error describing the problematic properties.
Source§fn contains_properties(property_type_ids: &[TypeId]) -> bool
fn contains_properties(property_type_ids: &[TypeId]) -> bool
Checks that this property list includes all properties in the given list.
Source§fn set_values_for_new_entity(
&self,
entity_id: EntityId<E>,
property_store: &mut PropertyStore<E>,
)
fn set_values_for_new_entity( &self, entity_id: EntityId<E>, property_store: &mut PropertyStore<E>, )
Assigns the given entity the property values in
self in the property_store.
This method does NOT emit property change events, as it is called upon entity creation.Source§fn get_values_for_entity(context: &Context, entity_id: EntityId<E>) -> Self
fn get_values_for_entity(context: &Context, entity_id: EntityId<E>) -> Self
Gets the tuple of property values for the given entity.
Source§fn contains_required_properties() -> bool
fn contains_required_properties() -> bool
Checks that this property list contains all required properties of the entity.
Source§impl<E: Entity, T: QueryInternal<E>> QueryInternal<E> for EntityPropertyTuple<E, T>
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
type QueryParts<'a> = <T as QueryInternal<E>>::QueryParts<'a> where Self: 'a
Allocation-free representation of the query parts exposed by this query.
Source§fn 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.
Source§fn 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.Source§fn is_empty_query(&self) -> bool
fn is_empty_query(&self) -> bool
Indicates whether this query matches the entire population for
E.Source§fn query_parts(&self) -> Self::QueryParts<'_>
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>
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
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)
fn filter_entities(&self, entities: &mut Vec<EntityId<E>>, context: &Context)
Removes all
EntityIds from the given vector that do not match this query.Source§fn 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.impl<E: Entity, T: Copy> Copy for EntityPropertyTuple<E, T>
impl<E: Entity, PL: PropertyList<E>> PropertyInitializationList<E> for EntityPropertyTuple<E, PL>
impl<E: Entity, QI: QueryInternal<E>> Query<E> for EntityPropertyTuple<E, QI>
Auto Trait Implementations§
impl<E, T> Freeze for EntityPropertyTuple<E, T>where
T: Freeze,
impl<E, T> RefUnwindSafe for EntityPropertyTuple<E, T>where
T: RefUnwindSafe,
E: RefUnwindSafe,
impl<E, T> Send for EntityPropertyTuple<E, T>
impl<E, T> Sync for EntityPropertyTuple<E, T>
impl<E, T> Unpin for EntityPropertyTuple<E, T>
impl<E, T> UnwindSafe for EntityPropertyTuple<E, T>where
T: UnwindSafe,
E: UnwindSafe,
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.