Skip to main content

AdaptWeight

Trait AdaptWeight 

Source
pub trait AdaptWeight<S: 'static, O: Operator<S>, W, Sc>: Send + Sync {
    type RowWeight: RowWeight<S, O, Sc>;

    // Required methods
    fn adapt(&self, weight: W) -> Self::RowWeight;
    fn is_hard(&self, weight: &W) -> bool;
}
Expand description

Turns an authored weight W into a RowWeight for operator O’s rows.

Required Associated Types§

Source

type RowWeight: RowWeight<S, O, Sc>

The row weight produced from W.

Required Methods§

Source

fn adapt(&self, weight: W) -> Self::RowWeight

Wraps weight as a row weight.

Source

fn is_hard(&self, weight: &W) -> bool

Reports whether weight marks the constraint hard.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<S, I, F, C, K, Acc, V, R, EB, P, B, W, Sc> AdaptWeight<S, JoinNode<S, GroupNode<I, F, C, K, Acc, V, R>, CollectionNode<S, EB>, P>, W, Sc> for GroupedJoinAdapter<K, R, B>
where S: 'static, I: Operator<S>, F: for<'a> Fn(&I::View<'a>) -> K + Send + Sync + 'static, C: for<'a> Collector<I::View<'a>, Value = V, Result = R, Accumulator = Acc> + 'static, K: Eq + Hash + Clone + Send + Sync + 'static, Acc: Accumulator<V, R> + 'static, V: Send + Sync + 'static, R: Send + Sync + 'static, B: Send + Sync + 'static, EB: CollectionExtract<S, Item = B> + 'static, for<'a> P: IndexedPlan + 'static + ExecutablePlan<GroupView<'a, S, I, K, Acc, V, R>, Leaf<'a, B>>, W: for<'a> ConstraintWeight<(&'a K, &'a R, &'a B), Sc> + Send + Sync, Sc: Score,

Source§

type RowWeight = GroupedJoinWeight<W>

Source§

impl<S, I, F, C, K, Acc, V, R, EB, P, D, B, W, KB, Sc> AdaptWeight<S, ComplementNode<S, CollectionNode<S, EB>, GroupNode<I, F, C, K, Acc, V, R>, P, D, R>, W, Sc> for DirectComplementAdapter<KB, K, R>
where S: 'static, I: Operator<S>, F: for<'a> Fn(&I::View<'a>) -> K + Send + Sync + 'static, C: for<'a> Collector<I::View<'a>, Value = V, Result = R, Accumulator = Acc> + 'static, K: Eq + Hash + Send + Sync + 'static, Acc: Accumulator<V, R> + 'static, V: Send + Sync + 'static, R: Send + Sync + 'static, B: Send + Sync + 'static, EB: CollectionExtract<S, Item = B> + 'static, for<'a> P: IndexedPlan + KeyOf + RightKeyOf<Key = <P as KeyOf>::Key> + 'static + ExecutablePlan<Leaf<'a, B>, GroupView<'a, S, I, K, Acc, V, R>>, D: for<'a> Fn(&S, &Leaf<'a, B>) -> R + Send + Sync + 'static, W: for<'a> ConstraintWeight<(&'a K, &'a R), Sc> + Send + Sync, KB: Fn(&B) -> K + Send + Sync + Clone, Sc: Score,

Source§

type RowWeight = DirectComplementWeight<W, KB>

Source§

impl<S, I, F, C, K, Acc, V, R, EB, P, D, B, W, KB, Sc> AdaptWeight<S, ComplementNode<S, CollectionNode<S, EB>, GroupNode<I, F, C, Option<K>, Acc, V, R>, P, D, R>, W, Sc> for OptionalComplementAdapter<KB, K, R>
where S: 'static, I: Operator<S>, F: for<'a> Fn(&I::View<'a>) -> Option<K> + Send + Sync + 'static, C: for<'a> Collector<I::View<'a>, Value = V, Result = R, Accumulator = Acc> + 'static, K: Eq + Hash + Send + Sync + 'static, Acc: Accumulator<V, R> + 'static, V: Send + Sync + 'static, R: Send + Sync + 'static, B: Send + Sync + 'static, EB: CollectionExtract<S, Item = B> + 'static, for<'a> P: IndexedPlan + KeyOf + RightKeyOf<Key = <P as KeyOf>::Key> + 'static + ExecutablePlan<Leaf<'a, B>, GroupView<'a, S, I, Option<K>, Acc, V, R>>, D: for<'a> Fn(&S, &Leaf<'a, B>) -> R + Send + Sync + 'static, W: for<'a> ConstraintWeight<(&'a K, &'a R), Sc> + Send + Sync, KB: Fn(&B) -> K + Send + Sync + Clone, Sc: Score,

Source§

type RowWeight = OptionalComplementWeight<W, KB>

Source§

impl<S, I, F, C, K, Acc, V, R, W, Sc> AdaptWeight<S, GroupNode<I, F, C, K, Acc, V, R>, W, Sc> for GroupAdapter<K, R>
where S: 'static, I: Operator<S>, F: for<'a> Fn(&I::View<'a>) -> K + Send + Sync + 'static, C: for<'a> Collector<I::View<'a>, Value = V, Result = R, Accumulator = Acc> + 'static, K: Eq + Hash + Clone + Send + Sync + 'static, Acc: Accumulator<V, R> + 'static, V: Send + Sync + 'static, R: Send + Sync + 'static, W: for<'a> ConstraintWeight<(&'a K, &'a R), Sc> + Send + Sync, Sc: Score,

Source§

type RowWeight = GroupWeight<W>