New method to iterate on a graph: libpijul::pristine::GraphIter::iter_graph

pmeunier
Aug 16, 2021, 10:29 AM
DF23IIGWXAIVX4EDVYTJ33Y65SIW7LJIZS2Z3QVADIJCIT6NEF4AC

Dependencies

  • [2] I24UEJQL Various post-fire fixes
  • [3] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [4] I52XSRUH Massive cleanup, and simplification
  • [5] YN63NUZO Sanakirja 1.0
  • [6] AAXP2534 Tags: completing the subcommand
  • [7] QMTANHVN Reset: only output changed files
  • [8] DNQHXWRZ address clippy hard errors
  • [9] TKEVOH7H Fixing a bug when downloading changes, and making change download more efficient (more async)
  • [10] VO5OQW4W Removing anyhow in libpijul
  • [11] QL6K2ZM3 Tags
  • [12] GHO6DWPI Refactoring iterators
  • [*] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).

Change contents

  • replacement in libpijul/src/pristine/mod.rs at line 478
    [3.51889][3.3784:3803]()
    fn iter_graph(
    [3.51889]
    [3.3803]
    fn graph_cursor(
  • edit in libpijul/src/pristine/mod.rs at line 488
    [3.102720]
    [3.52158]
    fn iter_graph<'a>(
    &'a self,
    g: &'a Self::Graph,
    s: Option<&Vertex<ChangeId>>,
    ) -> Result<GraphIterator<'a, Self>, TxnErr<Self::GraphError>> {
    Ok(GraphIterator {
    cursor: self.graph_cursor(g, s)?,
    txn: self,
    g: g,
    })
    }
  • edit in libpijul/src/pristine/mod.rs at line 502
    [3.52161]
    [3.52161]
    pub struct GraphIterator<'a, T: GraphIter> {
    txn: &'a T,
    g: &'a T::Graph,
    cursor: T::GraphCursor,
    }
    impl<'a, T: GraphIter> Iterator for GraphIterator<'a, T> {
    type Item = Result<(&'a Vertex<ChangeId>, &'a SerializedEdge), TxnErr<T::GraphError>>;
    fn next(&mut self) -> Option<Self::Item> {
    self.txn.next_graph(self.g, &mut self.cursor)
    }
    }
  • replacement in libpijul/src/pristine/mod.rs at line 1090
    [3.17878][3.3944:4006]()
    let mut cursor = txn.iter_graph(&channel, None).unwrap();
    [3.17878]
    [3.45536]
    let mut cursor = txn.graph_cursor(&channel, None).unwrap();
  • replacement in libpijul/src/pristine/mod.rs at line 1138
    [2.70044][3.4007:4069](),[3.46782][3.4007:4069]()
    let mut cursor = txn.iter_graph(&channel, None).unwrap();
    [2.70044]
    [3.54329]
    let mut cursor = txn.graph_cursor(&channel, None).unwrap();
  • replacement in libpijul/src/pristine/sanakirja.rs at line 631
    [3.38323][3.3333:3352]()
    fn iter_graph(
    [3.38323]
    [3.3352]
    fn graph_cursor(