Skip to main content

CrossBiConstraintStream

Struct CrossBiConstraintStream 

Source
pub struct CrossBiConstraintStream<S, A, B, K, EA, EB, KA, KB, F, Sc>
where Sc: Score,
{ /* private fields */ }

Implementations§

Source§

impl<S, A, B, K, EA, EB, KA, KB, Sc> CrossBiConstraintStream<S, A, B, K, EA, EB, KA, KB, TrueFilter, Sc>
where S: Send + Sync + 'static, A: Clone + Send + Sync + 'static, B: Clone + Send + Sync + 'static, K: Eq + Hash + Clone + Send + Sync, EA: Fn(&S) -> &[A] + Send + Sync, EB: Fn(&S) -> &[B] + Send + Sync, KA: Fn(&A) -> K + Send + Sync, KB: Fn(&B) -> K + Send + Sync, Sc: Score + 'static,

Source

pub fn new(extractor_a: EA, extractor_b: EB, key_a: KA, key_b: KB) -> Self

Source§

impl<S, A, B, K, EA, EB, KA, KB, F, Sc> CrossBiConstraintStream<S, A, B, K, EA, EB, KA, KB, F, Sc>
where S: Send + Sync + 'static, A: Clone + Send + Sync + 'static, B: Clone + Send + Sync + 'static, K: Eq + Hash + Clone + Send + Sync, EA: Fn(&S) -> &[A] + Send + Sync, EB: Fn(&S) -> &[B] + Send + Sync, KA: Fn(&A) -> K + Send + Sync, KB: Fn(&B) -> K + Send + Sync, F: BiFilter<S, A, B>, Sc: Score + 'static,

Source

pub fn new_with_filter( extractor_a: EA, extractor_b: EB, key_a: KA, key_b: KB, filter: F, ) -> Self

Source

pub fn filter<P>( self, predicate: P, ) -> CrossBiConstraintStream<S, A, B, K, EA, EB, KA, KB, AndBiFilter<F, FnBiFilter<impl Fn(&S, &A, &B) -> bool + Send + Sync>>, Sc>
where P: Fn(&A, &B) -> bool + Send + Sync,

Source

pub fn penalize( self, weight: Sc, ) -> CrossBiConstraintBuilder<S, A, B, K, EA, EB, KA, KB, F, impl Fn(&A, &B) -> Sc + Send + Sync, Sc>
where Sc: Copy,

Source

pub fn penalize_with<W>( self, weight_fn: W, ) -> CrossBiConstraintBuilder<S, A, B, K, EA, EB, KA, KB, F, W, Sc>
where W: Fn(&A, &B) -> Sc + Send + Sync,

Source

pub fn penalize_hard_with<W>( self, weight_fn: W, ) -> CrossBiConstraintBuilder<S, A, B, K, EA, EB, KA, KB, F, W, Sc>
where W: Fn(&A, &B) -> Sc + Send + Sync,

Source

pub fn reward( self, weight: Sc, ) -> CrossBiConstraintBuilder<S, A, B, K, EA, EB, KA, KB, F, impl Fn(&A, &B) -> Sc + Send + Sync, Sc>
where Sc: Copy,

Source

pub fn reward_with<W>( self, weight_fn: W, ) -> CrossBiConstraintBuilder<S, A, B, K, EA, EB, KA, KB, F, W, Sc>
where W: Fn(&A, &B) -> Sc + Send + Sync,

Source

pub fn reward_hard_with<W>( self, weight_fn: W, ) -> CrossBiConstraintBuilder<S, A, B, K, EA, EB, KA, KB, F, W, Sc>
where W: Fn(&A, &B) -> Sc + Send + Sync,

Source

pub fn flatten_last<C, CK, Flatten, CKeyFn, ALookup>( self, flatten: Flatten, c_key_fn: CKeyFn, a_lookup_fn: ALookup, ) -> FlattenedBiConstraintStream<S, A, B, C, K, CK, EA, EB, KA, KB, Flatten, CKeyFn, ALookup, TrueFilter, Sc>
where C: Clone + Send + Sync + 'static, CK: Eq + Hash + Clone + Send + Sync, Flatten: Fn(&B) -> &[C] + Send + Sync, CKeyFn: Fn(&C) -> CK + Send + Sync, ALookup: Fn(&A) -> CK + Send + Sync,

Trait Implementations§

Source§

impl<S, A, B, K, EA, EB, KA, KB, F, Sc: Score> Debug for CrossBiConstraintStream<S, A, B, K, EA, EB, KA, KB, F, Sc>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<S, A, B, K, EA, EB, KA, KB, F, Sc> Freeze for CrossBiConstraintStream<S, A, B, K, EA, EB, KA, KB, F, Sc>
where EA: Freeze, EB: Freeze, KA: Freeze, KB: Freeze, F: Freeze,

§

impl<S, A, B, K, EA, EB, KA, KB, F, Sc> RefUnwindSafe for CrossBiConstraintStream<S, A, B, K, EA, EB, KA, KB, F, Sc>

§

impl<S, A, B, K, EA, EB, KA, KB, F, Sc> Send for CrossBiConstraintStream<S, A, B, K, EA, EB, KA, KB, F, Sc>
where EA: Send, EB: Send, KA: Send, KB: Send, F: Send,

§

impl<S, A, B, K, EA, EB, KA, KB, F, Sc> Sync for CrossBiConstraintStream<S, A, B, K, EA, EB, KA, KB, F, Sc>
where EA: Sync, EB: Sync, KA: Sync, KB: Sync, F: Sync,

§

impl<S, A, B, K, EA, EB, KA, KB, F, Sc> Unpin for CrossBiConstraintStream<S, A, B, K, EA, EB, KA, KB, F, Sc>
where EA: Unpin, EB: Unpin, KA: Unpin, KB: Unpin, F: Unpin,

§

impl<S, A, B, K, EA, EB, KA, KB, F, Sc> UnsafeUnpin for CrossBiConstraintStream<S, A, B, K, EA, EB, KA, KB, F, Sc>

§

impl<S, A, B, K, EA, EB, KA, KB, F, Sc> UnwindSafe for CrossBiConstraintStream<S, A, B, K, EA, EB, KA, KB, F, Sc>
where EA: UnwindSafe, EB: UnwindSafe, KA: UnwindSafe, KB: UnwindSafe, F: UnwindSafe,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.