erpc_analysis::db_trait

Trait AnalysisDatabase

source
pub trait AnalysisDatabase: Send + Sync {
    // Required methods
    fn create_graph_projection<'life0, 'life1, 'async_trait>(
        &'life0 self,
        params: &'life1 GraphProjectionParams,
    ) -> Pin<Box<dyn Future<Output = Result<(), AnalysisError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete_graph_projection<'life0, 'life1, 'async_trait>(
        &'life0 self,
        projection_name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), AnalysisError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn check_graph_projection_exists<'life0, 'life1, 'async_trait>(
        &'life0 self,
        projection_name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, AnalysisError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn calculate_node_degrees<'life0, 'life1, 'async_trait>(
        &'life0 self,
        projection_name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<NodeMetrics>, AnalysisError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn calculate_graph_metrics<'life0, 'life1, 'async_trait>(
        &'life0 self,
        projection_name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<GraphMetrics, AnalysisError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn calculate_weakly_connected_components<'life0, 'life1, 'async_trait>(
        &'life0 self,
        projection_name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<ComponentAnalysisResult, AnalysisError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn calculate_strongly_connected_components<'life0, 'life1, 'async_trait>(
        &'life0 self,
        projection_name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<ComponentAnalysisResult, AnalysisError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait defining the interface for database operations required by the eRPC analysis engine.

Required Methods§

source

fn create_graph_projection<'life0, 'life1, 'async_trait>( &'life0 self, params: &'life1 GraphProjectionParams, ) -> Pin<Box<dyn Future<Output = Result<(), AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Creates or recreates a GDS graph projection. If a projection with the same name exists, it should ideally be dropped and recreated.

source

fn delete_graph_projection<'life0, 'life1, 'async_trait>( &'life0 self, projection_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Deletes an existing GDS graph projection if it exists. Should succeed even if the projection does not exist (making it idempotent).

source

fn check_graph_projection_exists<'life0, 'life1, 'async_trait>( &'life0 self, projection_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Checks if a GDS graph projection with the given name exists.

source

fn calculate_node_degrees<'life0, 'life1, 'async_trait>( &'life0 self, projection_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<NodeMetrics>, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Calculates node-level degree metrics for all nodes in a given GDS projection. Returns a vector of NodeMetrics containing in-degree, out-degree, and total degree for each node in the graph.

source

fn calculate_graph_metrics<'life0, 'life1, 'async_trait>( &'life0 self, projection_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<GraphMetrics, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Calculates comprehensive graph metrics for a given GDS projection including basic counts, degree distribution, and degree statistics.

source

fn calculate_weakly_connected_components<'life0, 'life1, 'async_trait>( &'life0 self, projection_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<ComponentAnalysisResult, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Calculates weakly connected components using Neo4j GDS WCC algorithm. Returns analysis results containing components, sizes, and statistics.

source

fn calculate_strongly_connected_components<'life0, 'life1, 'async_trait>( &'life0 self, projection_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<ComponentAnalysisResult, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Calculates strongly connected components using Neo4j GDS SCC algorithm. Returns analysis results containing components, sizes, and statistics.

Implementors§