pub trait FeatureConstraint: Send + Sync {
// Required method
fn evaluate(
&self,
move_ctx: &MoveContext<'_>,
) -> Option<ConstraintViolation>;
// Provided method
fn merge(&self, _source: Job, _candidate: Job) -> Result<Job, ViolationCode> { ... }
}
Expand description
Defines feature constraint behavior.
Required Methods§
Sourcefn evaluate(&self, move_ctx: &MoveContext<'_>) -> Option<ConstraintViolation>
fn evaluate(&self, move_ctx: &MoveContext<'_>) -> Option<ConstraintViolation>
Evaluates hard constraints violations.
Provided Methods§
Sourcefn merge(&self, _source: Job, _candidate: Job) -> Result<Job, ViolationCode>
fn merge(&self, _source: Job, _candidate: Job) -> Result<Job, ViolationCode>
Tries to merge two jobs taking into account common constraints. Returns a new job, if it is possible to merge them having a theoretically assignable job. Otherwise, returns violation error code. Default implementation returns an error with default ViolationCode.