GraphPluginLike

Trait GraphPluginLike 

pub trait GraphPluginLike<NK, Node, Edge>:
    Send
    + Sync
    + Debug {
    // Required methods
    fn get_name(&self) -> Arc<str>;
    fn enabled(&self) -> bool;
    fn clone_boxed(&self) -> Box<dyn GraphPluginLike<NK, Node, Edge>>;
    fn recognize_path(&mut self, graph: &Graph<Node, Edge>, path: &[NodeIndex]);
    fn report(&self) -> Box<dyn ReportLike>;
}
Expand description

A graph plugin is verifying properties solely on a graph.

The main API of plugin is recognize_path(), when verifying a graph, the caller calls this method multiple tiems with simple paths and conclude with a report. The report() method returns the internal state of the plugin.

Required Methods§

fn get_name(&self) -> Arc<str>

Get the name of the plugin

fn enabled(&self) -> bool

Check if the plugin is enabled

fn clone_boxed(&self) -> Box<dyn GraphPluginLike<NK, Node, Edge>>

Clone the plugin

fn recognize_path(&mut self, graph: &Graph<Node, Edge>, path: &[NodeIndex])

Recognize a path

fn report(&self) -> Box<dyn ReportLike>

Generate a report (after recognizing all paths in a graph)

Implementors§