pub trait Traverse {
// Required methods
fn flat_map<'a, T, F>(
&'a self,
working_set: &'a StateWorkingSet<'_>,
f: &F,
results: &mut Vec<T>,
)
where F: Fn(&'a Expression) -> Vec<T>;
fn find_map<'a, T, F>(
&'a self,
working_set: &'a StateWorkingSet<'_>,
f: &F,
) -> Option<T>
where F: Fn(&'a Expression) -> FindMapResult<T>;
}
Expand description
Trait for traversing the AST
Required Methods§
Sourcefn flat_map<'a, T, F>(
&'a self,
working_set: &'a StateWorkingSet<'_>,
f: &F,
results: &mut Vec<T>,
)
fn flat_map<'a, T, F>( &'a self, working_set: &'a StateWorkingSet<'_>, f: &F, results: &mut Vec<T>, )
Generic function that do flat_map on an AST node.
Concatenates all recursive results on sub-expressions
into the results
accumulator.
§Arguments
f
- function that generates leaf elementsresults
- accumulator
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.