Trait tree_sitter_graph::functions::Parameters
source · [−]pub trait Parameters {
fn param(&mut self) -> Result<Value, ExecutionError>;
fn finish(&mut self) -> Result<(), ExecutionError>;
}
Expand description
A helper trait for consuming the parameters of a function. You will typically use it as follows:
let first_param = params.param()?.into_string()?;
let second_param = params.param()?.as_integer()?;
// etc
params.finish()?;
Required Methods
fn param(&mut self) -> Result<Value, ExecutionError>
fn param(&mut self) -> Result<Value, ExecutionError>
Returns the next parameter, returning an error if you have exhausted all of the parameters that were passed in.
fn finish(&mut self) -> Result<(), ExecutionError>
fn finish(&mut self) -> Result<(), ExecutionError>
Ensures that there are no more parameters to consume.