Dispatcher

Trait Dispatcher 

Source
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§

Source

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

Source

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

Source

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

Source

fn list_available_types(&self) -> Vec<String>

List all available data object types

Source

fn is_type_registered(&self, object_type: &str) -> bool

Check if a data object type is registered

Source

fn get_connector(&self, object_type: &str) -> Option<&dyn Connector>

Get connector for a specific data object type

Implementors§