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§
Sourcefn add_behaviours(&self, relation_instance: ReactiveRelation)
fn add_behaviours(&self, relation_instance: ReactiveRelation)
Adds all behaviours to the given reactive relation instance.
Sourcefn add_behaviour(
&self,
relation_instance: ReactiveRelation,
behaviour_ty: &BehaviourTypeId,
)
fn add_behaviour( &self, relation_instance: ReactiveRelation, behaviour_ty: &BehaviourTypeId, )
Creates and adds the given behaviour to the given reactive entity instance.
Sourcefn remove_behaviour(
&self,
relation_instance: ReactiveRelation,
behaviour_ty: &BehaviourTypeId,
)
fn remove_behaviour( &self, relation_instance: ReactiveRelation, behaviour_ty: &BehaviourTypeId, )
Removes the given behaviour from the given reactive relation instance.
Sourcefn remove_behaviours(&self, relation_instance: ReactiveRelation)
fn remove_behaviours(&self, relation_instance: ReactiveRelation)
Removes all behaviours from the given reactive relation instance.
Sourcefn remove_behaviours_by_key(&self, relation_instance_id: &RelationInstanceId)
fn remove_behaviours_by_key(&self, relation_instance_id: &RelationInstanceId)
Removes all behaviours from the reactive relation instance with the given relation instance id.
Sourcefn remove_behaviours_by_behaviour(&self, behaviour_ty: &BehaviourTypeId)
fn remove_behaviours_by_behaviour(&self, behaviour_ty: &BehaviourTypeId)
Removes all behaviours of the given behaviour type.
Sourcefn has(
&self,
relation_instance: ReactiveRelation,
behaviour_ty: &BehaviourTypeId,
) -> bool
fn has( &self, relation_instance: ReactiveRelation, behaviour_ty: &BehaviourTypeId, ) -> bool
Returns true, if the relation instance has the given behaviour.
Sourcefn get_all(&self, relation_instance: ReactiveRelation) -> Vec<BehaviourTypeId>
fn get_all(&self, relation_instance: ReactiveRelation) -> Vec<BehaviourTypeId>
Returns the behaviours of the given relation instance.
Sourcefn get_instances_by_behaviour(
&self,
ty: &BehaviourTypeId,
) -> Vec<ReactiveRelation>
fn get_instances_by_behaviour( &self, ty: &BehaviourTypeId, ) -> Vec<ReactiveRelation>
Returns the relation instances with the given behaviour.
Sourcefn connect(
&self,
relation_instance: ReactiveRelation,
behaviour_ty: &BehaviourTypeId,
) -> Result<(), BehaviourTransitionError>
fn connect( &self, relation_instance: ReactiveRelation, behaviour_ty: &BehaviourTypeId, ) -> Result<(), BehaviourTransitionError>
Connect
Sourcefn disconnect(
&self,
relation_instance: ReactiveRelation,
behaviour_ty: &BehaviourTypeId,
) -> Result<(), BehaviourTransitionError>
fn disconnect( &self, relation_instance: ReactiveRelation, behaviour_ty: &BehaviourTypeId, ) -> Result<(), BehaviourTransitionError>
Disconnect