reactive_graph_plugin_api/
plugin_context.rs

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