pub trait PropertyList<E: Entity>: Copy + 'static {
// Required methods
fn validate() -> Result<(), IxaError>;
fn contains_properties(property_type_ids: &[TypeId]) -> bool;
fn set_values_for_new_entity(
&self,
entity_id: EntityId<E>,
property_store: &mut PropertyStore<E>,
);
fn get_values_for_entity(context: &Context, entity_id: EntityId<E>) -> Self;
// Provided method
fn contains_required_properties() -> bool { ... }
}Required Methods§
Sourcefn validate() -> Result<(), IxaError>
fn validate() -> Result<(), IxaError>
Validates that the properties are distinct. If not, returns an error describing the problematic properties.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Provided Methods§
Sourcefn contains_required_properties() -> bool
fn contains_required_properties() -> bool
Checks that this property list contains all required properties of the entity.
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.