(
nested: &mut Iterative<'b, S, u64>,
context: &mut I,
target_variables: &[Var],
left: CollectionRelation<'b, S>,
right: AttributeBinding,
)
| 181 | } |
| 182 | |
| 183 | fn collection_attribute<'b, T, S, I>( |
| 184 | nested: &mut Iterative<'b, S, u64>, |
| 185 | context: &mut I, |
| 186 | target_variables: &[Var], |
| 187 | left: CollectionRelation<'b, S>, |
| 188 | right: AttributeBinding, |
| 189 | ) -> (Implemented<'b, S>, ShutdownHandle) |
| 190 | where |
| 191 | T: Timestamp + Lattice, |
| 192 | I: ImplContext<T>, |
| 193 | S: Scope<Timestamp = T>, |
| 194 | { |
| 195 | // @TODO specialized implementation |
| 196 | |
| 197 | let (tuples, shutdown_propose) = match context.forward_propose(&right.source_attribute) { |
| 198 | None => panic!("attribute {:?} does not exist", &right.source_attribute), |
| 199 | Some(propose_trace) => { |
| 200 | let frontier: Vec<T> = propose_trace.advance_frontier().to_vec(); |
| 201 | let (propose, shutdown_propose) = |
| 202 | propose_trace.import_core(&nested.parent, &right.source_attribute); |
| 203 | |
| 204 | let tuples = propose |
| 205 | .enter_at(nested, move |_, _, time| { |
| 206 | let mut forwarded = time.clone(); |
| 207 | forwarded.advance_by(&frontier); |
| 208 | Product::new(forwarded, 0) |
| 209 | }) |
| 210 | .as_collection(|e, v| vec![e.clone(), v.clone()]); |
| 211 | |
| 212 | (tuples, shutdown_propose) |
| 213 | } |
| 214 | }; |
| 215 | |
| 216 | let right_collected = CollectionRelation { |
| 217 | variables: vec![right.variables.0, right.variables.1], |
| 218 | tuples, |
| 219 | }; |
| 220 | |
| 221 | let (implemented, mut shutdown_handle) = |
| 222 | collection_collection(nested, context, target_variables, left, right_collected); |
| 223 | |
| 224 | shutdown_handle.add_button(shutdown_propose); |
| 225 | |
| 226 | (implemented, shutdown_handle) |
| 227 | } |
| 228 | |
| 229 | // Some(var) => { |
| 230 | // assert!(*var == self.variables.1); |
no test coverage detected