Trait RelationBehaviourManager

Source
pub trait RelationBehaviourManager:
    Send
    + Sync
    + Lifecycle {
    // Required methods
    fn add_behaviours(&self, relation_instance: ReactiveRelation);
    fn add_behaviour(
        &self,
        relation_instance: ReactiveRelation,
        behaviour_ty: &BehaviourTypeId,
    );
    fn remove_behaviour(
        &self,
        relation_instance: ReactiveRelation,
        behaviour_ty: &BehaviourTypeId,
    );
    fn remove_behaviours(&self, relation_instance: ReactiveRelation);
    fn remove_behaviours_by_key(
        &self,
        relation_instance_id: &RelationInstanceId,
    );
    fn remove_behaviours_by_behaviour(&self, behaviour_ty: &BehaviourTypeId);
    fn has(
        &self,
        relation_instance: ReactiveRelation,
        behaviour_ty: &BehaviourTypeId,
    ) -> bool;
    fn get_all(
        &self,
        relation_instance: ReactiveRelation,
    ) -> Vec<BehaviourTypeId>;
    fn get_instances_by_behaviour(
        &self,
        ty: &BehaviourTypeId,
    ) -> Vec<ReactiveRelation>;
    fn connect(
        &self,
        relation_instance: ReactiveRelation,
        behaviour_ty: &BehaviourTypeId,
    ) -> Result<(), BehaviourTransitionError>;
    fn disconnect(
        &self,
        relation_instance: ReactiveRelation,
        behaviour_ty: &BehaviourTypeId,
    ) -> Result<(), BehaviourTransitionError>;
    fn reconnect(
        &self,
        relation_instance: ReactiveRelation,
        behaviour_ty: &BehaviourTypeId,
    ) -> Result<(), BehaviourTransitionError>;
}

Required Methods§

Source

fn add_behaviours(&self, relation_instance: ReactiveRelation)

Adds all behaviours to the given reactive relation instance.

Source

fn add_behaviour( &self, relation_instance: ReactiveRelation, behaviour_ty: &BehaviourTypeId, )

Creates and adds the given behaviour to the given reactive entity instance.

Source

fn remove_behaviour( &self, relation_instance: ReactiveRelation, behaviour_ty: &BehaviourTypeId, )

Removes the given behaviour from the given reactive relation instance.

Source

fn remove_behaviours(&self, relation_instance: ReactiveRelation)

Removes all behaviours from the given reactive relation instance.

Source

fn remove_behaviours_by_key(&self, relation_instance_id: &RelationInstanceId)

Removes all behaviours from the reactive relation instance with the given relation instance id.

Source

fn remove_behaviours_by_behaviour(&self, behaviour_ty: &BehaviourTypeId)

Removes all behaviours of the given behaviour type.

Source

fn has( &self, relation_instance: ReactiveRelation, behaviour_ty: &BehaviourTypeId, ) -> bool

Returns true, if the relation instance has the given behaviour.

Source

fn get_all(&self, relation_instance: ReactiveRelation) -> Vec<BehaviourTypeId>

Returns the behaviours of the given relation instance.

Source

fn get_instances_by_behaviour( &self, ty: &BehaviourTypeId, ) -> Vec<ReactiveRelation>

Returns the relation instances with the given behaviour.

Source

fn connect( &self, relation_instance: ReactiveRelation, behaviour_ty: &BehaviourTypeId, ) -> Result<(), BehaviourTransitionError>

Connect

Source

fn disconnect( &self, relation_instance: ReactiveRelation, behaviour_ty: &BehaviourTypeId, ) -> Result<(), BehaviourTransitionError>

Disconnect

Source

fn reconnect( &self, relation_instance: ReactiveRelation, behaviour_ty: &BehaviourTypeId, ) -> Result<(), BehaviourTransitionError>

Reconnect

Trait Implementations§

Source§

impl Injectable for dyn RelationBehaviourManager + Sync + Send

Implementors§