Trait RelationBehaviourRegistry

Source
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§

Source

fn register( &self, relation_behaviour_ty: RelationBehaviourTypeId, factory: Arc<dyn BehaviourFactory<RelationInstanceId, ReactiveRelation> + Send + Sync>, )

Registers a factory for creating relation behaviours.

Source

fn unregister(&self, relation_behaviour_ty: &RelationBehaviourTypeId)

Unregisters a factory for creating relation behaviours.

Source

fn get_all(&self) -> Vec<RelationBehaviourTypeId>

Returns all relation behaviours.

Source

fn get( &self, relation_ty: &RelationTypeId, ) -> Vec<Arc<dyn BehaviourFactory<RelationInstanceId, ReactiveRelation> + Send + Sync>>

Returns the relation behaviour factories for the given entity type.

Source

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.

Source

fn get_behaviour_types( &self, relation_ty: &RelationTypeId, ) -> Vec<RelationBehaviourTypeId>

Returns the relation behaviours for the given entity type.

Source

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.

Source

fn count(&self) -> usize

Returns the count of relation behaviours.

Trait Implementations§

Source§

impl Injectable for dyn RelationBehaviourRegistry + Sync + Send

Implementors§