Struct tree_sitter_graph::functions::Functions
source · pub struct Functions { /* private fields */ }Expand description
A library of named functions.
Implementations§
source§impl Functions
impl Functions
sourcepub fn stdlib() -> Functions
pub fn stdlib() -> Functions
Returns the standard library of functions, as defined in the language reference.
sourcepub fn add<F>(&mut self, name: Identifier, function: F)where
F: Function + Send + Sync + 'static,
pub fn add<F>(&mut self, name: Identifier, function: F)where F: Function + Send + Sync + 'static,
Adds a new function to this library.
sourcepub fn call(
&self,
name: &Identifier,
graph: &mut Graph<'_>,
source: &str,
parameters: &mut dyn Parameters
) -> Result<Value, ExecutionError>
pub fn call( &self, name: &Identifier, graph: &mut Graph<'_>, source: &str, parameters: &mut dyn Parameters ) -> Result<Value, ExecutionError>
Calls a named function, returning an error if there is no function with that name.