|
| 1 | +use crate::edge_differences::private::EdgeDifferenceIteration; |
1 | 2 | use crate::EdgeId; |
2 | 3 | use crate::NodeId; |
3 | 4 | use crate::Position; |
@@ -116,6 +117,46 @@ pub struct EdgeDifferences<'ts> { |
116 | 117 | right: f64, |
117 | 118 | } |
118 | 119 |
|
| 120 | +pub struct X<'ts, T: EdgeDifferenceIteration> { |
| 121 | + edges_left: &'ts [Position], |
| 122 | + edges_right: &'ts [Position], |
| 123 | + edges_parent: &'ts [NodeId], |
| 124 | + edges_child: &'ts [NodeId], |
| 125 | + removals: (usize, usize), |
| 126 | + marker: std::marker::PhantomData<T>, |
| 127 | +} |
| 128 | + |
| 129 | +impl<'ts, T: EdgeDifferenceIteration> Iterator for X<'ts, T> { |
| 130 | + type Item = EdgeDifference<T>; |
| 131 | + fn next(&mut self) -> Option<Self::Item> { |
| 132 | + todo!() |
| 133 | + } |
| 134 | +} |
| 135 | + |
| 136 | +impl<'ts> EdgeDifferences<'ts> { |
| 137 | + pub fn removals(&self) -> impl Iterator<Item = EdgeRemoval> + '_ { |
| 138 | + X { |
| 139 | + edges_left: self.edges_left, |
| 140 | + edges_right: self.edges_right, |
| 141 | + edges_parent: self.edges_parent, |
| 142 | + edges_child: self.edges_child, |
| 143 | + removals: self.removals, |
| 144 | + marker: std::marker::PhantomData::<Removal> {}, |
| 145 | + } |
| 146 | + } |
| 147 | + |
| 148 | + pub fn insertions(&self) -> impl Iterator<Item = EdgeInsertion> + '_ { |
| 149 | + X { |
| 150 | + edges_left: self.edges_left, |
| 151 | + edges_right: self.edges_right, |
| 152 | + edges_parent: self.edges_parent, |
| 153 | + edges_child: self.edges_child, |
| 154 | + removals: self.removals, |
| 155 | + marker: std::marker::PhantomData::<Insertion> {}, |
| 156 | + } |
| 157 | + } |
| 158 | +} |
| 159 | + |
119 | 160 | fn update_right( |
120 | 161 | right: f64, |
121 | 162 | index: usize, |
|
0 commit comments