pub trait Dispatcher: Send + Sync {
// Required methods
fn register_connector<'life0, 'life1, 'async_trait>(
&'life0 mut self,
object_type: &'life1 str,
connector: Box<dyn Connector>,
) -> Pin<Box<dyn Future<Output = NirvResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn route_query<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 InternalQuery,
) -> Pin<Box<dyn Future<Output = NirvResult<Vec<ConnectorQuery>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn execute_distributed_query<'life0, 'async_trait>(
&'life0 self,
queries: Vec<ConnectorQuery>,
) -> Pin<Box<dyn Future<Output = NirvResult<QueryResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_available_types(&self) -> Vec<String>;
fn is_type_registered(&self, object_type: &str) -> bool;
fn get_connector(&self, object_type: &str) -> Option<&dyn Connector>;
}Expand description
Central routing component that manages data object type resolution and connector selection
Required Methods§
Sourcefn register_connector<'life0, 'life1, 'async_trait>(
&'life0 mut self,
object_type: &'life1 str,
connector: Box<dyn Connector>,
) -> Pin<Box<dyn Future<Output = NirvResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn register_connector<'life0, 'life1, 'async_trait>(
&'life0 mut self,
object_type: &'life1 str,
connector: Box<dyn Connector>,
) -> Pin<Box<dyn Future<Output = NirvResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Register a connector for a specific data object type
Sourcefn route_query<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 InternalQuery,
) -> Pin<Box<dyn Future<Output = NirvResult<Vec<ConnectorQuery>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn route_query<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 InternalQuery,
) -> Pin<Box<dyn Future<Output = NirvResult<Vec<ConnectorQuery>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Route a query to appropriate connectors based on data object types
Sourcefn execute_distributed_query<'life0, 'async_trait>(
&'life0 self,
queries: Vec<ConnectorQuery>,
) -> Pin<Box<dyn Future<Output = NirvResult<QueryResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_distributed_query<'life0, 'async_trait>(
&'life0 self,
queries: Vec<ConnectorQuery>,
) -> Pin<Box<dyn Future<Output = NirvResult<QueryResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute a distributed query across multiple connectors
Sourcefn list_available_types(&self) -> Vec<String>
fn list_available_types(&self) -> Vec<String>
List all available data object types
Sourcefn is_type_registered(&self, object_type: &str) -> bool
fn is_type_registered(&self, object_type: &str) -> bool
Check if a data object type is registered
Sourcefn get_connector(&self, object_type: &str) -> Option<&dyn Connector>
fn get_connector(&self, object_type: &str) -> Option<&dyn Connector>
Get connector for a specific data object type