Trait tree_sitter_graph::functions::Parameters [−][src]
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(&graph)?;
let second_param = params.param()?.into_integer(&graph)?;
// 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.