reactive_graph_plugin_api/
plugin_context.rs

1use std::sync::Arc;
2
3use crate::CommandManager;
4use crate::ComponentImportExportManager;
5use crate::ComponentManager;
6use crate::ComponentProviderRegistry;
7use crate::ConfigManager;
8use crate::EntityBehaviourRegistry;
9use crate::EntityComponentBehaviourRegistry;
10use crate::EntityInstanceManager;
11use crate::EntityTypeImportExportManager;
12use crate::EntityTypeManager;
13use crate::EntityTypeProviderRegistry;
14use crate::FlowInstanceManager;
15use crate::FlowTypeImportExportManager;
16use crate::FlowTypeManager;
17use crate::FlowTypeProviderRegistry;
18use crate::GraphQLQueryService;
19use crate::RelationBehaviourRegistry;
20use crate::RelationComponentBehaviourRegistry;
21use crate::RelationInstanceManager;
22use crate::RelationTypeImportExportManager;
23use crate::RelationTypeManager;
24use crate::RelationTypeProviderRegistry;
25use crate::TypeSystemEventManager;
26use crate::WebResourceManager;
27use crate::springtime_di::injectable;
28
29// #[injectable]
30#[cfg_attr(feature = "springtime", injectable)]
31pub trait PluginContext: Send + Sync {
32    // Type System
33
34    /// Returns the component manager.
35    fn get_component_manager(&self) -> Arc<dyn ComponentManager + Send + Sync>;
36
37    /// Returns the component import export manager.
38    fn get_component_import_export_manager(&self) -> Arc<dyn ComponentImportExportManager + Send + Sync>;
39
40    /// Returns the component provider registry.
41    fn get_component_provider_registry(&self) -> Arc<dyn ComponentProviderRegistry + Send + Sync>;
42
43    /// Returns the entity type manager.
44    fn get_entity_type_manager(&self) -> Arc<dyn EntityTypeManager + Send + Sync>;
45
46    /// Returns the entity type import export manager.
47    fn get_entity_type_import_export_manager(&self) -> Arc<dyn EntityTypeImportExportManager + Send + Sync>;
48
49    /// Returns the entity type provider registry.
50    fn get_entity_type_provider_registry(&self) -> Arc<dyn EntityTypeProviderRegistry + Send + Sync>;
51
52    /// Returns the relation type manager.
53    fn get_relation_type_manager(&self) -> Arc<dyn RelationTypeManager + Send + Sync>;
54
55    /// Returns the relation type import export manager.
56    fn get_relation_type_import_export_manager(&self) -> Arc<dyn RelationTypeImportExportManager + Send + Sync>;
57
58    /// Returns the relation type provider registry.
59    fn get_relation_type_provider_registry(&self) -> Arc<dyn RelationTypeProviderRegistry + Send + Sync>;
60
61    /// Returns the flow type manager.
62    fn get_flow_type_manager(&self) -> Arc<dyn FlowTypeManager + Send + Sync>;
63
64    /// Returns the flow type import export manager.
65    fn get_flow_type_import_export_manager(&self) -> Arc<dyn FlowTypeImportExportManager + Send + Sync>;
66
67    /// Returns the flow type provider registry.
68    fn get_flow_type_provider_registry(&self) -> Arc<dyn FlowTypeProviderRegistry + Send + Sync>;
69
70    /// Returns the system event manager.
71    fn get_type_system_event_manager(&self) -> Arc<dyn TypeSystemEventManager + Send + Sync>;
72
73    // Instance System
74
75    /// Returns the entity instance manager.
76    fn get_entity_instance_manager(&self) -> Arc<dyn EntityInstanceManager + Send + Sync>;
77
78    /// Returns the relation instance manager.
79    fn get_relation_instance_manager(&self) -> Arc<dyn RelationInstanceManager + Send + Sync>;
80
81    /// Returns the flow instance manager.
82    fn get_flow_instance_manager(&self) -> Arc<dyn FlowInstanceManager + Send + Sync>;
83
84    // Behaviour Registries
85
86    /// Returns the entity behaviour registry.
87    fn get_entity_behaviour_registry(&self) -> Arc<dyn EntityBehaviourRegistry + Send + Sync>;
88
89    /// Returns the entity component behaviour registry.
90    fn get_entity_component_behaviour_registry(&self) -> Arc<dyn EntityComponentBehaviourRegistry + Send + Sync>;
91
92    /// Returns the relation behaviour registry.
93    fn get_relation_behaviour_registry(&self) -> Arc<dyn RelationBehaviourRegistry + Send + Sync>;
94
95    /// Returns the relation component behaviour registry.
96    fn get_relation_component_behaviour_registry(&self) -> Arc<dyn RelationComponentBehaviourRegistry + Send + Sync>;
97
98    // GraphQL Services
99
100    /// Returns the GraphQL query service.
101    fn get_graphql_query_service(&self) -> Arc<dyn GraphQLQueryService + Send + Sync>;
102
103    /// Returns the web resource manager.
104    fn get_web_resource_manager(&self) -> Arc<dyn WebResourceManager + Send + Sync>;
105
106    // System Services
107
108    /// Returns the config manager.
109    fn get_config_manager(&self) -> Arc<dyn ConfigManager + Send + Sync>;
110
111    /// Returns the command manager.
112    fn get_command_manager(&self) -> Arc<dyn CommandManager + Send + Sync>;
113}