Trait EntityInstanceContainer

Source
pub trait EntityInstanceContainer {
    // Required methods
    fn entity_instances(&self) -> EntityInstances;
    fn has_entity_instance(&self, id: Uuid) -> bool;
    fn add_entity_instance(
        &self,
        entity_instance: EntityInstance,
    ) -> Result<(), AddEntityInstanceError>;
    fn update_entity_instance(
        &self,
        id: Uuid,
        entity_instance: EntityInstance,
    ) -> Result<(Uuid, EntityInstance), UpdateEntityInstanceError>;
    fn remove_entity_instance(
        &self,
        id: Uuid,
    ) -> Result<Option<(Uuid, EntityInstance)>, RemoveEntityInstanceError>;
}
Expand description

Container for entity instances.

Required Methods§

Source

fn entity_instances(&self) -> EntityInstances

Returns the entity instances.

Source

fn has_entity_instance(&self, id: Uuid) -> bool

Returns true, if the container has an entity instance with the given id.

Source

fn add_entity_instance( &self, entity_instance: EntityInstance, ) -> Result<(), AddEntityInstanceError>

Adds the given entity instance.

Source

fn update_entity_instance( &self, id: Uuid, entity_instance: EntityInstance, ) -> Result<(Uuid, EntityInstance), UpdateEntityInstanceError>

Updates the entity instance with the id of the given entity instance.

Source

fn remove_entity_instance( &self, id: Uuid, ) -> Result<Option<(Uuid, EntityInstance)>, RemoveEntityInstanceError>

Removes the entity instance with the given id.

Implementors§