reactive_graph_behaviour_model_api/
container.rs

1use crate::BehaviourTypeId;
2use crate::BehaviourTypeIds;
3
4pub trait BehaviourTypeContainer {
5    fn ty(&self) -> BehaviourTypeId;
6}
7
8pub trait BehaviourTypesContainer {
9    /// Returns the behaviour types of the container.
10    fn get_behaviours(&self) -> Vec<BehaviourTypeId>;
11
12    /// Adds a behaviour to the container.
13    fn add_behaviour(&self, ty: BehaviourTypeId);
14
15    /// Removes a behaviour from the container.
16    fn remove_behaviour(&self, ty: &BehaviourTypeId);
17
18    /// Returns true, if the reactive instance behaves as the given behaviour.
19    fn behaves_as(&self, ty: &BehaviourTypeId) -> bool;
20
21    /// Returns true, if the reactive instance behaves as all the given behaviours.
22    fn behaves_as_all(&self, tys: &BehaviourTypeIds) -> bool;
23}