fn visit_pre_boxes_in_subgraph<'a, F, E>(&'a self, f: &mut F, start_box: BoxId) -> Result<(), E>
    where
        F: FnMut(Ref<'a, QueryBox>) -> Result<(), E>,
    {
        let mut visited = HashSet::new();
        let mut stack = vec![start_box];
        while !stack.is_empty() {
            let box_id = stack.pop().unwrap();
            if visited.insert(box_id) {
                let query_box = self.boxes.get(&box_id).expect("a valid box identifier");
                f(query_box.borrow())?;

                stack.extend(
                    query_box
                        .borrow()
                        .quantifiers
                        .iter()
                        .rev()
                        .map(|q| self.get_quantifier(*q).input_box),
                );
            }
        }
        Ok(())
    }
/// Visit boxes in the query graph in pre-order
Visit boxes in the query graph in pre-order
Visit boxes in the query graph in pre - order
fn visit_pre_boxes_in_subgraph<'a, F, E>(&'a self, f: &mut F, start_box: BoxId) -> Result<(), E>
    where
        F: FnMut(Ref<'a, QueryBox>) -> Result<(), E>,
    {
        let mut visited = HashSet::new();
        let mut stack = vec![start_box];
        while !stack.is_empty() {
            let box_id = stack.pop().unwrap();
            if visited.insert(box_id) {
                let query_box = self.boxes.get(&box_id).expect("a valid box identifier");
                f(query_box.borrow())?;
                stack.extend(
                    query_box
                        .borrow()
                        .quantifiers
                        .iter()
                        .rev()
                        .map(|q| self.get_quantifier(*q).input_box),
                );
            }
        }
        Ok(())
    }
fn visit_pre_boxes_in_subgraph < ' a , F , E > ( & ' a self , f : & mut F , start_box : BoxId ) -> Result < ( ) , E > where F : FnMut ( Ref < ' a , QueryBox > ) -> Result < ( ) , E > , { let mut visited = HashSet :: new ( ) ; let mut stack = vec ! [ start_box ] ; while ! stack . is_empty ( ) { let box_id = stack . pop ( ) . unwrap ( ) ; if visited . insert ( box_id ) { let query_box = self . boxes . get ( & box_id ) . expect ( " " ) ; f ( query_box . borrow ( ) ) ? ; stack . extend ( query_box . borrow ( ) . quantifiers . iter ( ) . rev ( ) . map ( | q | self . get_quantifier ( * q ) . input_box ) , ) ; } } Ok ( ( ) ) }
Visit boxes in the query graph in pre-order
Visit boxes in the query graph in pre - order
&'a self
f
&mut F
start_box
BoxId
&'a self
f
&mut F
start_box
BoxId