Skip to main content

rewrite_graph_patterns_with_progress

Function rewrite_graph_patterns_with_progress 

Source
pub fn rewrite_graph_patterns_with_progress<F>(
    graph: &SqliteGraph,
    rule: &RewriteRule,
    bounds: RewriteBounds,
    progress: &F,
) -> Result<RewriteResult, SqliteGraphError>
Expand description

Applies rewrite rules with progress tracking.

Same as rewrite_graph_patterns but reports progress during the operation. Useful for large graphs where rewriting may take time.

§Arguments

  • graph - The target graph to transform
  • rule - Rewrite rule specifying pattern, replacement, and interface
  • bounds - Limits on the rewriting operation
  • progress - Callback for progress updates

§Progress Reports

  • Finding pattern matches
  • Applying each rewrite
  • Validating the result

§Example

use sqlitegraph::{
    algo::{rewrite_graph_patterns_with_progress, RewriteRule, RewriteBounds},
    progress::ConsoleProgress,
};

let progress = ConsoleProgress::new();
let result = rewrite_graph_patterns_with_progress(
    &graph,
    &rule,
    RewriteBounds::default(),
    &progress
)?;