use crate::graph::graph_classifier::{GraphClassifier, GraphValue};
use crate::graph::graph_query::GraphQuery;
use crate::graph::graph_view::GraphView;
use crate::pattern::Pattern;
#[inline]
pub fn map_with_context<Extra, V: GraphValue>(
_classifier: &GraphClassifier<Extra, V>,
f: impl Fn(&GraphQuery<V>, Pattern<V>) -> Pattern<V>,
view: GraphView<Extra, V>,
) -> GraphView<Extra, V> {
let snapshot = view.view_query.clone();
let view_elements = view
.view_elements
.into_iter()
.map(|(cls, p)| (cls, f(&snapshot, p)))
.collect();
GraphView {
view_query: snapshot,
view_elements,
}
}