Skip to main content

Extension

Trait Extension 

Source
pub trait Extension: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn procedures(&self) -> Vec<ProcedureSignature>;
    fn execute(
        &self,
        procedure: &str,
        args: &[String],
        adjacency: &HashMap<i64, Vec<(i64, f64)>>,
    ) -> Result<Vec<Vec<TypedValue>>, String>;

    // Provided method
    fn needs_graph(&self) -> bool { ... }
}
Expand description

Trait that every extension must implement.

Required Methods§

Source

fn name(&self) -> &str

Extension name (e.g., “algo”).

Source

fn procedures(&self) -> Vec<ProcedureSignature>

List all procedures this extension provides.

Source

fn execute( &self, procedure: &str, args: &[String], adjacency: &HashMap<i64, Vec<(i64, f64)>>, ) -> Result<Vec<Vec<TypedValue>>, String>

Execute a named procedure with string arguments. Returns rows of typed values, column-ordered per the procedure signature.

Provided Methods§

Source

fn needs_graph(&self) -> bool

Whether this extension needs the graph adjacency map. Defaults to false. Override to true for graph algorithm extensions.

Implementations on Foreign Types§

Source§

impl Extension for RdfExtension

Source§

fn name(&self) -> &str

Source§

fn procedures(&self) -> Vec<ProcedureSignature>

Source§

fn execute( &self, procedure: &str, args: &[String], _adjacency: &HashMap<i64, Vec<(i64, f64)>>, ) -> Result<Vec<Vec<TypedValue>>, String>

Implementors§