MCPcopy Create free account
hub / github.com/comnik/declarative-dataflow / projected

Method projected

src/lib.rs:550–577  ·  view source on GitHub ↗
(
        self,
        _nested: &mut Iterative<'a, G, u64>,
        _context: &mut I,
        target_variables: &[Var],
    )

Source from the content-addressed store, hash-verified

548 }
549
550 fn projected(
551 self,
552 _nested: &mut Iterative<'a, G, u64>,
553 _context: &mut I,
554 target_variables: &[Var],
555 ) -> (
556 Collection<Iterative<'a, G, u64>, Vec<Value>, isize>,
557 ShutdownHandle,
558 ) {
559 if self.variables() == target_variables {
560 (self.tuples, ShutdownHandle::empty())
561 } else {
562 let relation_variables = self.variables();
563 let target_variables = target_variables.to_vec();
564
565 let tuples = self.tuples.map(move |tuple| {
566 target_variables
567 .iter()
568 .map(|x| {
569 let idx = relation_variables.binds(*x).unwrap();
570 tuple[idx].clone()
571 })
572 .collect()
573 });
574
575 (tuples, ShutdownHandle::empty())
576 }
577 }
578
579 fn tuples_by_variables(
580 self,

Callers 6

tuplesMethod · 0.80
implementMethod · 0.80
implementMethod · 0.80
implementMethod · 0.80
implementMethod · 0.80
implementMethod · 0.80

Calls 3

forward_proposeMethod · 0.80
variablesMethod · 0.45
bindsMethod · 0.45

Tested by

no test coverage detected