Trait tree_sitter_graph::functions::Function

source ·
pub trait Function {
    // Required method
    fn call(
        &self,
        graph: &mut Graph<'_>,
        source: &str,
        parameters: &mut dyn Parameters
    ) -> Result<Value, ExecutionError>;
}
Expand description

The implementation of a function that can be called from the graph DSL.

You have access to the graph, as it has been constructed up to the point of the function call, as well as the text content of the source file that’s being processed.

Any other data that you need must be passed in as a parameter to the function. You can use the Parameters trait to consume those parameters and verify that you received the correct number and type of them.

Required Methods§

source

fn call( &self, graph: &mut Graph<'_>, source: &str, parameters: &mut dyn Parameters ) -> Result<Value, ExecutionError>

Implementors§