pub trait IncrementalConstraint<S, Sc: Score>:
IncrementalConstraintSealed
+ Send
+ Sync {
// Required methods
fn evaluate(&self, solution: &S) -> Sc;
fn match_count(&self, solution: &S) -> usize;
fn initialize(&mut self, solution: &S) -> Sc;
fn on_insert(
&mut self,
solution: &S,
entity_index: usize,
descriptor_index: usize,
) -> Sc;
fn on_retract(
&mut self,
solution: &S,
entity_index: usize,
descriptor_index: usize,
) -> Sc;
fn reset(&mut self);
fn constraint_ref(&self) -> &ConstraintRef;
// Provided methods
fn name(&self) -> &str { ... }
fn is_hard(&self) -> bool { ... }
fn get_matches<'a>(
&'a self,
_solution: &S,
) -> Vec<DetailedConstraintMatch<'a, Sc>> { ... }
fn weight(&self) -> Sc { ... }
}Required Methods§
fn evaluate(&self, solution: &S) -> Sc
fn match_count(&self, solution: &S) -> usize
fn initialize(&mut self, solution: &S) -> Sc
fn on_insert( &mut self, solution: &S, entity_index: usize, descriptor_index: usize, ) -> Sc
fn on_retract( &mut self, solution: &S, entity_index: usize, descriptor_index: usize, ) -> Sc
fn reset(&mut self)
fn constraint_ref(&self) -> &ConstraintRef
Provided Methods§
fn name(&self) -> &str
fn is_hard(&self) -> bool
fn get_matches<'a>( &'a self, _solution: &S, ) -> Vec<DetailedConstraintMatch<'a, Sc>>
fn weight(&self) -> Sc
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".