Trait FeatureConstraint

Source
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§

Source

fn evaluate(&self, move_ctx: &MoveContext<'_>) -> Option<ConstraintViolation>

Evaluates hard constraints violations.

Provided Methods§

Source

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.

Implementors§