pub fn work(&mut self, mut deadline_expired: impl FnMut() -> bool) -> bool {
        while let Some(instruction) = self.stack.pop() {
            match instruction {
                DiffInstruction::Diff { old, new } => self.diff_node(old, new),
                DiffInstruction::Create { node } => self.create_node(node),
                DiffInstruction::Mount { and } => self.mount(and),
                DiffInstruction::PrepareMove { node } => {
                    let num_on_stack = self.push_all_nodes(node);
                    self.stack.add_child_count(num_on_stack);
                }
                DiffInstruction::PopScope => self.stack.pop_off_scope(),
                DiffInstruction::PopElement => {
                    self.stack.element_stack.pop();
                }
            };

            if deadline_expired() {
                log::trace!("Deadline expired before we could finish!");
                return false;
            }
        }

        true
    }
/// Progress the diffing for this "fiber"
///
/// This method implements a depth-first iterative tree traversal.
///
/// We do depth-first to maintain high cache locality (nodes were originally generated recursively).
///
/// Returns a `bool` indicating that the work completed properly.
Progress the diffing for this "fiber"
This method implements a depth-first iterative tree traversal.

We do depth-first to maintain high cache locality (nodes were originally generated recursively).

Returns a `bool` indicating that the work completed properly.
Progress the diffing for this " fiber " This method implements a depth - first iterative tree traversal . We do depth - first to maintain high cache locality ( nodes were originally generated recursively ) . Returns a ` bool ` indicating that the work completed properly .
pub fn work(&mut self, mut deadline_expired: impl FnMut() -> bool) -> bool {
        while let Some(instruction) = self.stack.pop() {
            match instruction {
                DiffInstruction::Diff { old, new } => self.diff_node(old, new),
                DiffInstruction::Create { node } => self.create_node(node),
                DiffInstruction::Mount { and } => self.mount(and),
                DiffInstruction::PrepareMove { node } => {
                    let num_on_stack = self.push_all_nodes(node);
                    self.stack.add_child_count(num_on_stack);
                }
                DiffInstruction::PopScope => self.stack.pop_off_scope(),
                DiffInstruction::PopElement => {
                    self.stack.element_stack.pop();
                }
            };
            if deadline_expired() {
                log::trace!("Deadline expired before we could finish!");
                return false;
            }
        }
        true
    }
pub fn work ( & mut self , mut deadline_expired : impl FnMut ( ) -> bool ) -> bool { while let Some ( instruction ) = self . stack . pop ( ) { match instruction { DiffInstruction :: Diff { old , new } => self . diff_node ( old , new ) , DiffInstruction :: Create { node } => self . create_node ( node ) , DiffInstruction :: Mount { and } => self . mount ( and ) , DiffInstruction :: PrepareMove { node } => { let num_on_stack = self . push_all_nodes ( node ) ; self . stack . add_child_count ( num_on_stack ) ; } DiffInstruction :: PopScope => self . stack . pop_off_scope ( ) , DiffInstruction :: PopElement => { self . stack . element_stack . pop ( ) ; } } ; if deadline_expired ( ) { log :: trace ! ( " " ) ; return false ; } } true }
Progress the diffing for this "fiber"
This method implements a depth-first iterative tree traversal.
Progress the diffing for this " fiber " This method implements a depth - first iterative tree traversal .
&mut self
deadline_expired
impl FnMut() -> bool