fn flush(&mut self, node: &mut VecNode) -> io::Result<()> where Store: store::StoreMut {
        assert!(node.level > 0, "Cannot flush leaf nodes: no children to flush into.");

        let span = node.as_node().longest_pending_span();
        assert!(span.len() > 0, "Trying to flush node with no pending datoms.");

        // Make a new version of the child node, with the pending datoms flushed
        // into it. We get at least one new child page id, and possibly
        // additional midpoint datoms and child pages to add in this node.
        let child = node.children[span.end];
        let mut to_merge = self.insert_into(child, &node.datoms[span.start..span.end])?;

        debug_assert_eq!(
            to_merge.level, node.level,
            "Result of insert_into must have same level as node to flush.",
        );
        debug_assert_eq!(
            to_merge.datoms.len() + 1, to_merge.children.len(),
            "Result of insert_into must have one more child than midpoint datoms.",
        );
        debug_assert!(
            to_merge.datoms.len() <= span.len(),
            "Flushing must not make a node bigger.",
        );

        // Update the current node to remove the flushed datoms, and also the
        // old child pointer. Then insert the new midpoints (if there are any),
        // and the new child pointer.
        node.datoms.splice(span.start..span.end, to_merge.datoms.drain(..));
        node.children.splice(span.start..span.end + 1, to_merge.children.drain(..));

        Ok(())
    }
/// Flush pending datoms of the node into one child node.
///
/// Flushes the longest span of pending datoms. There must be at least one
/// pending datom in order to flush. This method panics if there are no
/// pending datoms.
///
/// This method updates the node to be flushed in place, such that when the
/// method returns, the child id has been updated for the child into which
/// datoms were flushed, and the flushed datoms have been removed from the
/// input node.
///
/// To flush all pending datoms, call this method repeatedly.
Flush pending datoms of the node into one child node.
Flushes the longest span of pending datoms. There must be at least one
pending datom in order to flush. This method panics if there are no
pending datoms.

This method updates the node to be flushed in place, such that when the
method returns, the child id has been updated for the child into which
datoms were flushed, and the flushed datoms have been removed from the
input node.

To flush all pending datoms, call this method repeatedly.
Flush pending datoms of the node into one child node . Flushes the longest span of pending datoms . There must be at least one pending datom in order to flush . This method panics if there are no pending datoms . This method updates the node to be flushed in place such that when the method returns the child id has been updated for the child into which datoms were flushed and the flushed datoms have been removed from the input node . To flush all pending datoms call this method repeatedly .
fn flush(&mut self, node: &mut VecNode) -> io::Result<()> where Store: store::StoreMut {
        assert!(node.level > 0, "Cannot flush leaf nodes: no children to flush into.");
        let span = node.as_node().longest_pending_span();
        assert!(span.len() > 0, "Trying to flush node with no pending datoms.");
        // Make a new version of the child node, with the pending datoms flushed
        // into it. We get at least one new child page id, and possibly
        // additional midpoint datoms and child pages to add in this node.
        let child = node.children[span.end];
        let mut to_merge = self.insert_into(child, &node.datoms[span.start..span.end])?;
        debug_assert_eq!(
            to_merge.level, node.level,
            "Result of insert_into must have same level as node to flush.",
        );
        debug_assert_eq!(
            to_merge.datoms.len() + 1, to_merge.children.len(),
            "Result of insert_into must have one more child than midpoint datoms.",
        );
        debug_assert!(
            to_merge.datoms.len() <= span.len(),
            "Flushing must not make a node bigger.",
        );
        // Update the current node to remove the flushed datoms, and also the
        // old child pointer. Then insert the new midpoints (if there are any),
        // and the new child pointer.
        node.datoms.splice(span.start..span.end, to_merge.datoms.drain(..));
        node.children.splice(span.start..span.end + 1, to_merge.children.drain(..));
        Ok(())
    }
fn flush ( & mut self , node : & mut VecNode ) -> io :: Result < ( ) > where Store : store :: StoreMut { assert ! ( node level 0 " " ) ; let span = node . as_node ( ) . longest_pending_span ( ) ; assert ! ( span len ( ) 0 " " ) ; // Make a new version of the child node, with the pending datoms flushed // into it. We get at least one new child page id, and possibly // additional midpoint datoms and child pages to add in this node. let child = node . children [ span . end ] ; let mut to_merge = self . insert_into ( child , & node . datoms [ span . start .. span . end ] ) ? ; debug_assert_eq ! ( to_merge level node level " " ) ; debug_assert_eq ! ( to_merge datoms len ( ) 1 to_merge children len ( ) " " ) ; debug_assert ! ( to_merge datoms len ( ) span len ( ) " " ) ; // Update the current node to remove the flushed datoms, and also the // old child pointer. Then insert the new midpoints (if there are any), // and the new child pointer. node . datoms . splice ( span . start .. span . end , to_merge . datoms . drain ( .. ) ) ; node . children . splice ( span . start .. span . end + 1 , to_merge . children . drain ( .. ) ) ; Ok ( ( ) ) }
Flush pending datoms of the node into one child node.
Flush pending datoms of the node into one child node .
&mut self
node
&mut VecNode
&mut self
node
&mut VecNode