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