pub struct Stream<S, Out, Src, F, Sc>where
Sc: Score,{ /* private fields */ }Expand description
Stream of projected rows Out from source Src, filtered by F; built by
UniConstraintStream::project.
Implementations§
Source§impl<S, Out, Src, F, Sc> Stream<S, Out, Src, F, Sc>
impl<S, Out, Src, F, Sc> Stream<S, Out, Src, F, Sc>
Sourcepub fn filter<P>(
self,
predicate: P,
) -> Stream<S, Out, Src, AndUniFilter<F, FnUniFilter<impl Fn(&S, &Out) -> bool + Send + Sync>>, Sc>
pub fn filter<P>( self, predicate: P, ) -> Stream<S, Out, Src, AndUniFilter<F, FnUniFilter<impl Fn(&S, &Out) -> bool + Send + Sync>>, Sc>
Keeps only rows for which predicate returns true, after the existing filter.
Sourcepub fn merge<OtherSrc, OtherF>(
self,
other: Stream<S, Out, OtherSrc, OtherF, Sc>,
) -> Stream<S, Out, MergedSource<FilteredSource<S, Out, Src, F>, FilteredSource<S, Out, OtherSrc, OtherF>>, TrueFilter, Sc>where
OtherSrc: Source<S, Out>,
OtherF: UniFilter<S, Out>,
pub fn merge<OtherSrc, OtherF>(
self,
other: Stream<S, Out, OtherSrc, OtherF, Sc>,
) -> Stream<S, Out, MergedSource<FilteredSource<S, Out, Src, F>, FilteredSource<S, Out, OtherSrc, OtherF>>, TrueFilter, Sc>where
OtherSrc: Source<S, Out>,
OtherF: UniFilter<S, Out>,
Merges with another projected stream of the same row type: the result emits the rows of both, each filtered by its own stream’s filter.
Sourcepub fn group_by<K, KF, C, V, R, Acc>(
self,
key_fn: KF,
collector: C,
) -> Grouped<S, Out, K, Src, F, KF, C, V, R, Acc, Sc>
pub fn group_by<K, KF, C, V, R, Acc>( self, key_fn: KF, collector: C, ) -> Grouped<S, Out, K, Src, F, KF, C, V, R, Acc, Sc>
Groups rows by key_fn, aggregating each group with collector.
Sourcepub fn join<J>(self, joiner: J) -> J::Outputwhere
J: ProjectedJoinTarget<S, Out, Src, F, Sc>,
pub fn join<J>(self, joiner: J) -> J::Outputwhere
J: ProjectedJoinTarget<S, Out, Src, F, Sc>,
Self-joins the rows; see
ProjectedJoinTarget.
Sourcepub fn penalize<W>(
self,
weight: W,
) -> Builder<S, Out, Src, F, impl Fn(&Out) -> Sc + Send + Sync, Sc>
pub fn penalize<W>( self, weight: W, ) -> Builder<S, Out, Src, F, impl Fn(&Out) -> Sc + Send + Sync, Sc>
Penalizes each match by weight.
weight is a fixed score, or a closure over the matched row 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,
) -> Builder<S, Out, Src, F, impl Fn(&Out) -> Sc + Send + Sync, Sc>
pub fn reward<W>( self, weight: W, ) -> Builder<S, Out, Src, F, impl Fn(&Out) -> Sc + Send + Sync, Sc>
Rewards each match by weight.
weight is a fixed score, or a closure over the matched row returning one.
A fixed weight with a non-zero hard level marks the constraint hard; closures
are soft unless wrapped in hard_weight.