pub struct ConstraintAnalysis<Sc: Score> {
pub constraint_ref: ConstraintRef,
pub weight: Sc,
pub score: Sc,
pub matches: Vec<DetailedConstraintMatch<Sc>>,
pub is_hard: bool,
}Expand description
Per-constraint breakdown in a score explanation.
Fields§
§constraint_ref: ConstraintRefConstraint reference.
weight: ScConstraint weight (score per match).
score: ScTotal score from this constraint.
matches: Vec<DetailedConstraintMatch<Sc>>All matches for this constraint.
is_hard: boolWhether this is a hard constraint.
Implementations§
Source§impl<Sc: Score> ConstraintAnalysis<Sc>
impl<Sc: Score> ConstraintAnalysis<Sc>
Sourcepub fn new(
constraint_ref: ConstraintRef,
weight: Sc,
score: Sc,
matches: Vec<DetailedConstraintMatch<Sc>>,
is_hard: bool,
) -> Self
pub fn new( constraint_ref: ConstraintRef, weight: Sc, score: Sc, matches: Vec<DetailedConstraintMatch<Sc>>, is_hard: bool, ) -> Self
Creates a new constraint analysis.
Sourcepub fn match_count(&self) -> usize
pub fn match_count(&self) -> usize
Returns the number of matches.
Trait Implementations§
Source§impl<Sc: Clone + Score> Clone for ConstraintAnalysis<Sc>
impl<Sc: Clone + Score> Clone for ConstraintAnalysis<Sc>
Source§fn clone(&self) -> ConstraintAnalysis<Sc>
fn clone(&self) -> ConstraintAnalysis<Sc>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<Sc> Freeze for ConstraintAnalysis<Sc>where
Sc: Freeze,
impl<Sc> !RefUnwindSafe for ConstraintAnalysis<Sc>
impl<Sc> Send for ConstraintAnalysis<Sc>
impl<Sc> Sync for ConstraintAnalysis<Sc>
impl<Sc> Unpin for ConstraintAnalysis<Sc>where
Sc: Unpin,
impl<Sc> !UnwindSafe for ConstraintAnalysis<Sc>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more