fn advance(&mut self, level: usize) {
        let old_index = self.begin.indices[level];
        self.begin.indices[level] = old_index + 1;

        assert!(
            old_index < self.nodes[level].datoms.len(),
            "Cannot have yielded from past the datoms array."
        );
        assert!(
            self.begin.indices[level] < self.nodes[level].children.len(),
            "Cannot increment out of bounds of children array."
        );

        // If we stepped over a midpoint datom, then we exhausted all of the
        // child nodes below it, so we need to replenish the levels below.
        if self.nodes[level].is_midpoint_at(old_index) {
            for k in (0..level).rev() {
                let index = self.begin.indices[k + 1];
                let child_pid = match self.nodes[k + 1].next_midpoint(index) {
                    Some(pid) => pid,
                    None => panic!("Node at level {} should have one more child.", k + 1),
                };
                let node = get_node(self.store, child_pid);
                assert_eq!(node.level as usize, k);
                self.nodes[k] = node;
                self.begin.indices[k] = 0;
            }
        }
    }
/// Advance the begin pointer after yielding a datom.
///
/// `level` is the index into the `nodes` and `indices` stacks
/// from which we just yielded a datom.
Advance the begin pointer after yielding a datom.
Advance the begin pointer after yielding a datom .
fn advance(&mut self, level: usize) {
        let old_index = self.begin.indices[level];
        self.begin.indices[level] = old_index + 1;
        assert!(
            old_index < self.nodes[level].datoms.len(),
            "Cannot have yielded from past the datoms array."
        );
        assert!(
            self.begin.indices[level] < self.nodes[level].children.len(),
            "Cannot increment out of bounds of children array."
        );
        // If we stepped over a midpoint datom, then we exhausted all of the
        // child nodes below it, so we need to replenish the levels below.
        if self.nodes[level].is_midpoint_at(old_index) {
            for k in (0..level).rev() {
                let index = self.begin.indices[k + 1];
                let child_pid = match self.nodes[k + 1].next_midpoint(index) {
                    Some(pid) => pid,
                    None => panic!("Node at level {} should have one more child.", k + 1),
                };
                let node = get_node(self.store, child_pid);
                assert_eq!(node.level as usize, k);
                self.nodes[k] = node;
                self.begin.indices[k] = 0;
            }
        }
    }
fn advance ( & mut self , level : usize ) { let old_index = self . begin . indices [ level ] ; self . begin . indices [ level ] = old_index + 1 ; assert ! ( old_index self nodes [ level ] datoms len ( ) " " ) ; assert ! ( self begin indices [ level ] self nodes [ level ] children len ( ) " " ) ; // If we stepped over a midpoint datom, then we exhausted all of the // child nodes below it, so we need to replenish the levels below. if self . nodes [ level ] . is_midpoint_at ( old_index ) { for k in ( 0 .. level ) . rev ( ) { let index = self . begin . indices [ k + 1 ] ; let child_pid = match self . nodes [ k + 1 ] . next_midpoint ( index ) { Some ( pid ) => pid , None => panic ! ( " " k 1 ) , } ; let node = get_node ( self . store , child_pid ) ; assert_eq ! ( node level as usize k ) ; self . nodes [ k ] = node ; self . begin . indices [ k ] = 0 ; } } }
Advance the begin pointer after yielding a datom.
Advance the begin pointer after yielding a datom .
&mut self
level
usize
&mut self
level
usize