Skip to main content

OptionalComplementAdapter

Struct OptionalComplementAdapter 

Source
pub struct OptionalComplementAdapter<KB, K, R> { /* private fields */ }
Expand description

Like DirectComplementAdapter, for groups keyed by Option<K>.

Implementations§

Source§

impl<KB, K, R> OptionalComplementAdapter<KB, K, R>

Source

pub fn new(key: KB) -> Self

Creates the adapter around the complement target key key.

Trait Implementations§

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>

The row weight produced from W.
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.

Auto Trait Implementations§

§

impl<KB, K, R> Forget for OptionalComplementAdapter<KB, K, R>

§

impl<KB, K, R> Freeze for OptionalComplementAdapter<KB, K, R>
where KB: Freeze, PhantomData<fn() -> (K, R)>: Freeze,

§

impl<KB, K, R> RefUnwindSafe for OptionalComplementAdapter<KB, K, R>

§

impl<KB, K, R> Send for OptionalComplementAdapter<KB, K, R>
where KB: Send, PhantomData<fn() -> (K, R)>: Send,

§

impl<KB, K, R> Sync for OptionalComplementAdapter<KB, K, R>
where KB: Sync, PhantomData<fn() -> (K, R)>: Sync,

§

impl<KB, K, R> Unpin for OptionalComplementAdapter<KB, K, R>
where KB: Unpin, PhantomData<fn() -> (K, R)>: Unpin,

§

impl<KB, K, R> UnsafeUnpin for OptionalComplementAdapter<KB, K, R>

§

impl<KB, K, R> UnwindSafe for OptionalComplementAdapter<KB, K, R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.