pub trait RelationInstanceManager: Send + Sync {
Show 19 methods
// Required methods
fn has(&self, id: &RelationInstanceId) -> bool;
fn get(&self, id: &RelationInstanceId) -> Option<ReactiveRelation>;
fn get_by_outbound_entity(
&self,
outbound_entity_id: Uuid,
) -> Vec<ReactiveRelation>;
fn get_by_inbound_entity(
&self,
inbound_entity_id: Uuid,
) -> Vec<ReactiveRelation>;
fn get_all(&self) -> Vec<ReactiveRelation>;
fn get_by_type(&self, ty: &RelationTypeId) -> Vec<ReactiveRelation>;
fn get_by_namespace(&self, namespace: &str) -> Vec<ReactiveRelation>;
fn get_keys(&self) -> Vec<RelationInstanceId>;
fn count(&self) -> usize;
fn count_by_type(&self, ty: &RelationTypeId) -> usize;
fn count_by_component(&self, component: &ComponentTypeId) -> usize;
fn count_by_behaviour(&self, behaviour_ty: &BehaviourTypeId) -> usize;
fn create(
&self,
relation_instance: RelationInstance,
) -> Result<ReactiveRelation, ReactiveRelationCreationError>;
fn register(
&self,
reactive_relation: ReactiveRelation,
) -> Result<ReactiveRelation, ReactiveRelationRegistrationError>;
fn add_component(
&self,
relation_instance_id: &RelationInstanceId,
component: &ComponentTypeId,
) -> Result<(), ReactiveRelationComponentAddError>;
fn remove_component(
&self,
relation_instance_id: &RelationInstanceId,
component: &ComponentTypeId,
) -> Result<(), ReactiveRelationComponentRemoveError>;
fn add_property(
&self,
relation_instance_id: &RelationInstanceId,
property_name: &str,
mutability: Mutability,
value: Value,
) -> Result<(), ReactiveRelationPropertyAddError>;
fn remove_property(
&self,
relation_instance_id: &RelationInstanceId,
property_name: &str,
) -> Result<(), ReactiveRelationPropertyRemoveError>;
fn delete(&self, relation_instance_id: &RelationInstanceId) -> bool;
}
Required Methods§
Sourcefn has(&self, id: &RelationInstanceId) -> bool
fn has(&self, id: &RelationInstanceId) -> bool
Returns true, if an relation of the given type exists which starts at the given outbound entity and ends at the given inbound entity.
Sourcefn get(&self, id: &RelationInstanceId) -> Option<ReactiveRelation>
fn get(&self, id: &RelationInstanceId) -> Option<ReactiveRelation>
Returns the ReactiveRelation with the given type_name, which starts at the given outbound entity and ends at the given inbound entity.
Sourcefn get_by_outbound_entity(
&self,
outbound_entity_id: Uuid,
) -> Vec<ReactiveRelation>
fn get_by_outbound_entity( &self, outbound_entity_id: Uuid, ) -> Vec<ReactiveRelation>
Returns all reactive relation instances of the given outbound entity instance.
Sourcefn get_by_inbound_entity(
&self,
inbound_entity_id: Uuid,
) -> Vec<ReactiveRelation>
fn get_by_inbound_entity( &self, inbound_entity_id: Uuid, ) -> Vec<ReactiveRelation>
Returns all reactive relation instances of the given inbound entity instance.
Sourcefn get_by_type(&self, ty: &RelationTypeId) -> Vec<ReactiveRelation>
fn get_by_type(&self, ty: &RelationTypeId) -> Vec<ReactiveRelation>
Returns all reactive relation instances of the given type.
Sourcefn get_by_namespace(&self, namespace: &str) -> Vec<ReactiveRelation>
fn get_by_namespace(&self, namespace: &str) -> Vec<ReactiveRelation>
Returns all reactive relation instances of the given namespace.
Sourcefn count_by_type(&self, ty: &RelationTypeId) -> usize
fn count_by_type(&self, ty: &RelationTypeId) -> usize
Returns the count of registered reactive relation instances of the given type.
Sourcefn count_by_component(&self, component: &ComponentTypeId) -> usize
fn count_by_component(&self, component: &ComponentTypeId) -> usize
Returns the count of registered reactive relation instances which are of the given component.
Sourcefn count_by_behaviour(&self, behaviour_ty: &BehaviourTypeId) -> usize
fn count_by_behaviour(&self, behaviour_ty: &BehaviourTypeId) -> usize
Returns the count of registered reactive relation instances which behaves as the given behaviour.
Sourcefn create(
&self,
relation_instance: RelationInstance,
) -> Result<ReactiveRelation, ReactiveRelationCreationError>
fn create( &self, relation_instance: RelationInstance, ) -> Result<ReactiveRelation, ReactiveRelationCreationError>
Creates a new reactive relation instance.
Sourcefn register(
&self,
reactive_relation: ReactiveRelation,
) -> Result<ReactiveRelation, ReactiveRelationRegistrationError>
fn register( &self, reactive_relation: ReactiveRelation, ) -> Result<ReactiveRelation, ReactiveRelationRegistrationError>
Registers the given reactive relation instance and applies components and behaviours.
Sourcefn add_component(
&self,
relation_instance_id: &RelationInstanceId,
component: &ComponentTypeId,
) -> Result<(), ReactiveRelationComponentAddError>
fn add_component( &self, relation_instance_id: &RelationInstanceId, component: &ComponentTypeId, ) -> Result<(), ReactiveRelationComponentAddError>
Adds the component with the given name to the relation instance with the given relation instance id.
Sourcefn remove_component(
&self,
relation_instance_id: &RelationInstanceId,
component: &ComponentTypeId,
) -> Result<(), ReactiveRelationComponentRemoveError>
fn remove_component( &self, relation_instance_id: &RelationInstanceId, component: &ComponentTypeId, ) -> Result<(), ReactiveRelationComponentRemoveError>
Removes the component with the given name from the relation instance with the given relation instance id.
Sourcefn add_property(
&self,
relation_instance_id: &RelationInstanceId,
property_name: &str,
mutability: Mutability,
value: Value,
) -> Result<(), ReactiveRelationPropertyAddError>
fn add_property( &self, relation_instance_id: &RelationInstanceId, property_name: &str, mutability: Mutability, value: Value, ) -> Result<(), ReactiveRelationPropertyAddError>
Adds the property with the given name and initial value to the relation instance with the given id.
Sourcefn remove_property(
&self,
relation_instance_id: &RelationInstanceId,
property_name: &str,
) -> Result<(), ReactiveRelationPropertyRemoveError>
fn remove_property( &self, relation_instance_id: &RelationInstanceId, property_name: &str, ) -> Result<(), ReactiveRelationPropertyRemoveError>
Removes the property with the given name from the relation instance with the given id.