pub trait RelationBehaviourRegistry:
Send
+ Sync
+ Lifecycle {
// Required methods
fn register(
&self,
relation_behaviour_ty: RelationBehaviourTypeId,
factory: Arc<dyn BehaviourFactory<RelationInstanceId, ReactiveRelation> + Send + Sync>,
);
fn unregister(&self, relation_behaviour_ty: &RelationBehaviourTypeId);
fn get_all(&self) -> Vec<RelationBehaviourTypeId>;
fn get(
&self,
relation_ty: &RelationTypeId,
) -> Vec<Arc<dyn BehaviourFactory<RelationInstanceId, ReactiveRelation> + Send + Sync>>;
fn get_factory_by_behaviour_type(
&self,
behaviour_ty: &BehaviourTypeId,
) -> Option<Arc<dyn BehaviourFactory<RelationInstanceId, ReactiveRelation> + Send + Sync>>;
fn get_behaviour_types(
&self,
relation_ty: &RelationTypeId,
) -> Vec<RelationBehaviourTypeId>;
fn get_by_behaviour_type(
&self,
behaviour_ty: &BehaviourTypeId,
) -> Option<RelationBehaviourTypeId>;
fn count(&self) -> usize;
}
Required Methods§
Sourcefn register(
&self,
relation_behaviour_ty: RelationBehaviourTypeId,
factory: Arc<dyn BehaviourFactory<RelationInstanceId, ReactiveRelation> + Send + Sync>,
)
fn register( &self, relation_behaviour_ty: RelationBehaviourTypeId, factory: Arc<dyn BehaviourFactory<RelationInstanceId, ReactiveRelation> + Send + Sync>, )
Registers a factory for creating relation behaviours.
Sourcefn unregister(&self, relation_behaviour_ty: &RelationBehaviourTypeId)
fn unregister(&self, relation_behaviour_ty: &RelationBehaviourTypeId)
Unregisters a factory for creating relation behaviours.
Sourcefn get(
&self,
relation_ty: &RelationTypeId,
) -> Vec<Arc<dyn BehaviourFactory<RelationInstanceId, ReactiveRelation> + Send + Sync>>
fn get( &self, relation_ty: &RelationTypeId, ) -> Vec<Arc<dyn BehaviourFactory<RelationInstanceId, ReactiveRelation> + Send + Sync>>
Returns the relation behaviour factories for the given entity type.
Sourcefn get_factory_by_behaviour_type(
&self,
behaviour_ty: &BehaviourTypeId,
) -> Option<Arc<dyn BehaviourFactory<RelationInstanceId, ReactiveRelation> + Send + Sync>>
fn get_factory_by_behaviour_type( &self, behaviour_ty: &BehaviourTypeId, ) -> Option<Arc<dyn BehaviourFactory<RelationInstanceId, ReactiveRelation> + Send + Sync>>
Returns the relation behaviour for the given behaviour type if the relation behaviour exists.
Sourcefn get_behaviour_types(
&self,
relation_ty: &RelationTypeId,
) -> Vec<RelationBehaviourTypeId>
fn get_behaviour_types( &self, relation_ty: &RelationTypeId, ) -> Vec<RelationBehaviourTypeId>
Returns the relation behaviours for the given entity type.
Sourcefn get_by_behaviour_type(
&self,
behaviour_ty: &BehaviourTypeId,
) -> Option<RelationBehaviourTypeId>
fn get_by_behaviour_type( &self, behaviour_ty: &BehaviourTypeId, ) -> Option<RelationBehaviourTypeId>
Returns the relation behaviour for the given behaviour type if the relation behaviour exists.