pub struct ConstraintAnalysis<'a, Sc: Score> {
pub constraint_ref: &'a ConstraintRef,
pub weight_multiplier: u32,
pub score: Sc,
pub matches: Vec<DetailedConstraintMatch<'a, Sc>>,
pub is_hard: bool,
}Expand description
Per-constraint breakdown in a score explanation.
Fields§
§constraint_ref: &'a ConstraintRefConstraint reference.
weight_multiplier: u32Bound runtime weight multiplier; 0 means the constraint is disabled.
score: ScTotal (weighted) score from this constraint.
matches: Vec<DetailedConstraintMatch<'a, Sc>>All matches for this constraint.
is_hard: boolWhether this is a hard constraint.
Implementations§
Source§impl<'a, Sc: Score> ConstraintAnalysis<'a, Sc>
impl<'a, Sc: Score> ConstraintAnalysis<'a, Sc>
Sourcepub fn new(
constraint_ref: &'a ConstraintRef,
weight_multiplier: u32,
score: Sc,
matches: Vec<DetailedConstraintMatch<'a, Sc>>,
is_hard: bool,
) -> Self
pub fn new( constraint_ref: &'a ConstraintRef, weight_multiplier: u32, score: Sc, matches: Vec<DetailedConstraintMatch<'a, 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§
Auto Trait Implementations§
impl<'a, Sc> !RefUnwindSafe for ConstraintAnalysis<'a, Sc>
impl<'a, Sc> !UnwindSafe for ConstraintAnalysis<'a, Sc>
impl<'a, Sc> Freeze for ConstraintAnalysis<'a, Sc>
impl<'a, Sc> Send for ConstraintAnalysis<'a, Sc>
impl<'a, Sc> Sync for ConstraintAnalysis<'a, Sc>
impl<'a, Sc> Unpin for ConstraintAnalysis<'a, Sc>
impl<'a, Sc> UnsafeUnpin for ConstraintAnalysis<'a, 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