pub struct Quad<S, A, B, C, D, EA, EB, EC, ED, P1, P2, P3, F, Sc>where
Sc: Score,
P1: CompileCondition<Plan: IndexedPlan>,
P2: CompileCondition<Plan: IndexedPlan>,
P3: CompileCondition<Plan: IndexedPlan>,{ /* private fields */ }Expand description
Four-collection join stream: ((A ⋈ B) ⋈ C) ⋈ D, each relationship
compiled from its own joiner (P1, P2, P3), so each left key reads the
whole row joined so far.
Implementations§
Source§impl<S, A, B, C, D, EA, EB, EC, ED, P1, P2, P3, F, Sc> Quad<S, A, B, C, D, EA, EB, EC, ED, P1, P2, P3, F, Sc>where
S: Send + Sync + 'static,
A: Send + Sync + 'static,
B: Send + Sync + 'static,
C: Send + Sync + 'static,
D: Send + Sync + 'static,
EA: 'static,
EB: 'static,
EC: 'static,
ED: 'static,
P1: CompileCondition<Plan: IndexedPlan> + 'static,
P2: CompileCondition<Plan: IndexedPlan> + 'static,
P3: CompileCondition<Plan: IndexedPlan> + 'static,
for<'a> JoinNode<S, JoinNode<S, JoinNode<S, CollectionNode<S, EA>, CollectionNode<S, EB>, <P1 as CompileCondition>::Plan>, CollectionNode<S, EC>, <P2 as CompileCondition>::Plan>, CollectionNode<S, ED>, <P3 as CompileCondition>::Plan>: Operator<S>,
F: QuadFilter<S, A, B, C, D>,
Sc: Score + 'static,
impl<S, A, B, C, D, EA, EB, EC, ED, P1, P2, P3, F, Sc> Quad<S, A, B, C, D, EA, EB, EC, ED, P1, P2, P3, F, Sc>where
S: Send + Sync + 'static,
A: Send + Sync + 'static,
B: Send + Sync + 'static,
C: Send + Sync + 'static,
D: Send + Sync + 'static,
EA: 'static,
EB: 'static,
EC: 'static,
ED: 'static,
P1: CompileCondition<Plan: IndexedPlan> + 'static,
P2: CompileCondition<Plan: IndexedPlan> + 'static,
P3: CompileCondition<Plan: IndexedPlan> + 'static,
for<'a> JoinNode<S, JoinNode<S, JoinNode<S, CollectionNode<S, EA>, CollectionNode<S, EB>, <P1 as CompileCondition>::Plan>, CollectionNode<S, EC>, <P2 as CompileCondition>::Plan>, CollectionNode<S, ED>, <P3 as CompileCondition>::Plan>: Operator<S>,
F: QuadFilter<S, A, B, C, D>,
Sc: Score + 'static,
Sourcepub fn filter<P>(
self,
predicate: P,
) -> Quad<S, A, B, C, D, EA, EB, EC, ED, P1, P2, P3, AndQuadFilter<F, FnQuadFilter<impl Fn(&S, &A, &B, &C, &D, usize, usize, usize, usize) -> bool + Send + Sync>>, Sc>
pub fn filter<P>( self, predicate: P, ) -> Quad<S, A, B, C, D, EA, EB, EC, ED, P1, P2, P3, AndQuadFilter<F, FnQuadFilter<impl Fn(&S, &A, &B, &C, &D, usize, usize, usize, usize) -> bool + Send + Sync>>, Sc>
Adds a filter predicate to the stream.
Sourcepub fn join<E, EE, P4>(
self,
target: (EE, P4),
) -> Penta<S, A, B, C, D, E, EA, EB, EC, ED, EE, P1, P2, P3, P4, QuadAsPentaFilter<F, A, B, C, D>, Sc>where
E: Send + Sync + 'static,
EE: CollectionExtract<S, Item = E> + 'static,
P4: CompileCondition + 'static,
for<'a> P4::Plan: IndexedPlan + ExecutablePlan<Pair<Pair<Pair<Leaf<'a, A>, Leaf<'a, B>>, Leaf<'a, C>>, Leaf<'a, D>>, Leaf<'a, E>>,
for<'a> JoinNode<S, JoinNode<S, JoinNode<S, CollectionNode<S, EA>, CollectionNode<S, EB>, <P1 as CompileCondition>::Plan>, CollectionNode<S, EC>, <P2 as CompileCondition>::Plan>, CollectionNode<S, ED>, <P3 as CompileCondition>::Plan>: Operator<S, View<'a> = Pair<Pair<Pair<Leaf<'a, A>, Leaf<'a, B>>, Leaf<'a, C>>, Leaf<'a, D>>>,
for<'a> JoinNode<S, JoinNode<S, JoinNode<S, JoinNode<S, CollectionNode<S, EA>, CollectionNode<S, EB>, <P1 as CompileCondition>::Plan>, CollectionNode<S, EC>, <P2 as CompileCondition>::Plan>, CollectionNode<S, ED>, <P3 as CompileCondition>::Plan>, CollectionNode<S, EE>, <P4 as CompileCondition>::Plan>: Operator<S>,
pub fn join<E, EE, P4>(
self,
target: (EE, P4),
) -> Penta<S, A, B, C, D, E, EA, EB, EC, ED, EE, P1, P2, P3, P4, QuadAsPentaFilter<F, A, B, C, D>, Sc>where
E: Send + Sync + 'static,
EE: CollectionExtract<S, Item = E> + 'static,
P4: CompileCondition + 'static,
for<'a> P4::Plan: IndexedPlan + ExecutablePlan<Pair<Pair<Pair<Leaf<'a, A>, Leaf<'a, B>>, Leaf<'a, C>>, Leaf<'a, D>>, Leaf<'a, E>>,
for<'a> JoinNode<S, JoinNode<S, JoinNode<S, CollectionNode<S, EA>, CollectionNode<S, EB>, <P1 as CompileCondition>::Plan>, CollectionNode<S, EC>, <P2 as CompileCondition>::Plan>, CollectionNode<S, ED>, <P3 as CompileCondition>::Plan>: Operator<S, View<'a> = Pair<Pair<Pair<Leaf<'a, A>, Leaf<'a, B>>, Leaf<'a, C>>, Leaf<'a, D>>>,
for<'a> JoinNode<S, JoinNode<S, JoinNode<S, JoinNode<S, CollectionNode<S, EA>, CollectionNode<S, EB>, <P1 as CompileCondition>::Plan>, CollectionNode<S, EC>, <P2 as CompileCondition>::Plan>, CollectionNode<S, ED>, <P3 as CompileCondition>::Plan>, CollectionNode<S, EE>, <P4 as CompileCondition>::Plan>: Operator<S>,
Extends this quadruple with a fifth source E.
Later joins of a chain take VIEW keys, not entity keys: the left key
closure receives the whole borrowed (A, B, C, D) row, the right key
receives &Leaf<'_, E> and reads fields via .entity. equal_bi with
entity closures does NOT typecheck here (E0631) — use equal_on.
Sourcepub fn penalize<W>(
self,
weight: W,
) -> QuadBuilder<S, A, B, C, D, EA, EB, EC, ED, P1, P2, P3, F, impl Fn(&A, &B, &C, &D) -> Sc + Send + Sync, Sc>
pub fn penalize<W>( self, weight: W, ) -> QuadBuilder<S, A, B, C, D, EA, EB, EC, ED, P1, P2, P3, F, impl Fn(&A, &B, &C, &D) -> Sc + Send + Sync, Sc>
Penalizes each match by weight.
weight is a fixed score, or a closure over the matched entities returning one.
A fixed weight with a non-zero hard level marks the constraint hard; closures
are soft unless wrapped in hard_weight.
Sourcepub fn reward<W>(
self,
weight: W,
) -> QuadBuilder<S, A, B, C, D, EA, EB, EC, ED, P1, P2, P3, F, impl Fn(&A, &B, &C, &D) -> Sc + Send + Sync, Sc>
pub fn reward<W>( self, weight: W, ) -> QuadBuilder<S, A, B, C, D, EA, EB, EC, ED, P1, P2, P3, F, impl Fn(&A, &B, &C, &D) -> Sc + Send + Sync, Sc>
Rewards each match by weight.
weight is a fixed score, or a closure over the matched entities returning one.
A fixed weight with a non-zero hard level marks the constraint hard; closures
are soft unless wrapped in hard_weight.
Source§impl<S, A, B, C, D, EA, EB, EC, ED, P1, P2, P3, F, Sc> Quad<S, A, B, C, D, EA, EB, EC, ED, P1, P2, P3, F, Sc>where
S: Send + Sync + 'static,
A: Send + Sync + 'static,
B: Send + Sync + 'static,
C: Send + Sync + 'static,
D: Send + Sync + 'static,
EA: 'static,
EB: 'static,
EC: 'static,
ED: 'static,
P1: CompileCondition<Plan: IndexedPlan> + 'static,
P2: CompileCondition<Plan: IndexedPlan> + 'static,
P3: CompileCondition<Plan: IndexedPlan> + 'static,
for<'a> JoinNode<S, JoinNode<S, JoinNode<S, CollectionNode<S, EA>, CollectionNode<S, EB>, <P1 as CompileCondition>::Plan>, CollectionNode<S, EC>, <P2 as CompileCondition>::Plan>, CollectionNode<S, ED>, <P3 as CompileCondition>::Plan>: Operator<S, View<'a> = Pair<Pair<Pair<Leaf<'a, A>, Leaf<'a, B>>, Leaf<'a, C>>, Leaf<'a, D>>> + Send + Sync,
F: QuadFilter<S, A, B, C, D> + 'static,
Sc: Score + 'static,
impl<S, A, B, C, D, EA, EB, EC, ED, P1, P2, P3, F, Sc> Quad<S, A, B, C, D, EA, EB, EC, ED, P1, P2, P3, F, Sc>where
S: Send + Sync + 'static,
A: Send + Sync + 'static,
B: Send + Sync + 'static,
C: Send + Sync + 'static,
D: Send + Sync + 'static,
EA: 'static,
EB: 'static,
EC: 'static,
ED: 'static,
P1: CompileCondition<Plan: IndexedPlan> + 'static,
P2: CompileCondition<Plan: IndexedPlan> + 'static,
P3: CompileCondition<Plan: IndexedPlan> + 'static,
for<'a> JoinNode<S, JoinNode<S, JoinNode<S, CollectionNode<S, EA>, CollectionNode<S, EB>, <P1 as CompileCondition>::Plan>, CollectionNode<S, EC>, <P2 as CompileCondition>::Plan>, CollectionNode<S, ED>, <P3 as CompileCondition>::Plan>: Operator<S, View<'a> = Pair<Pair<Pair<Leaf<'a, A>, Leaf<'a, B>>, Leaf<'a, C>>, Leaf<'a, D>>> + Send + Sync,
F: QuadFilter<S, A, B, C, D> + 'static,
Sc: Score + 'static,
Sourcepub fn group_by<GK, GF, Co, V, R, Acc>(
self,
key: GF,
collector: Co,
) -> JoinedGroupedStream<S, FilterNode<JoinNode<S, JoinNode<S, JoinNode<S, CollectionNode<S, EA>, CollectionNode<S, EB>, <P1 as CompileCondition>::Plan>, CollectionNode<S, EC>, <P2 as CompileCondition>::Plan>, CollectionNode<S, ED>, <P3 as CompileCondition>::Plan>, impl Fn(&S, &Pair<Pair<Pair<Leaf<'_, A>, Leaf<'_, B>>, Leaf<'_, C>>, Leaf<'_, D>>) -> bool + Send + Sync>, impl Fn(&Pair<Pair<Pair<Leaf<'_, A>, Leaf<'_, B>>, Leaf<'_, C>>, Leaf<'_, D>>) -> GK + Send + Sync, TupleCollector<Co, V, R, Acc>, GK, V, R, Acc, Sc>
pub fn group_by<GK, GF, Co, V, R, Acc>( self, key: GF, collector: Co, ) -> JoinedGroupedStream<S, FilterNode<JoinNode<S, JoinNode<S, JoinNode<S, CollectionNode<S, EA>, CollectionNode<S, EB>, <P1 as CompileCondition>::Plan>, CollectionNode<S, EC>, <P2 as CompileCondition>::Plan>, CollectionNode<S, ED>, <P3 as CompileCondition>::Plan>, impl Fn(&S, &Pair<Pair<Pair<Leaf<'_, A>, Leaf<'_, B>>, Leaf<'_, C>>, Leaf<'_, D>>) -> bool + Send + Sync>, impl Fn(&Pair<Pair<Pair<Leaf<'_, A>, Leaf<'_, B>>, Leaf<'_, C>>, Leaf<'_, D>>) -> GK + Send + Sync, TupleCollector<Co, V, R, Acc>, GK, V, R, Acc, Sc>
Groups joined tuples by a key and an owned-value collector. Upstream filters remain binding on full and incremental evaluation.