pub struct Indictment<Sc: Score> {
pub entity: EntityRef,
pub score: Sc,
pub constraint_matches: HashMap<ConstraintRef, Vec<DetailedConstraintMatch<Sc>>>,
}Expand description
Analysis of how a single entity impacts the score.
Fields§
§entity: EntityRefThe entity being analyzed.
score: ScTotal score impact from this entity.
constraint_matches: HashMap<ConstraintRef, Vec<DetailedConstraintMatch<Sc>>>Matches involving this entity, grouped by constraint.
Implementations§
Source§impl<Sc: Score> Indictment<Sc>
impl<Sc: Score> Indictment<Sc>
Sourcepub fn add_match(&mut self, constraint_match: DetailedConstraintMatch<Sc>)
pub fn add_match(&mut self, constraint_match: DetailedConstraintMatch<Sc>)
Adds a match to this indictment.
Sourcepub fn match_count(&self) -> usize
pub fn match_count(&self) -> usize
Returns the total number of constraint violations.
Sourcepub fn violated_constraints(&self) -> Vec<&ConstraintRef>
pub fn violated_constraints(&self) -> Vec<&ConstraintRef>
Returns the constraint refs for all violated constraints.
Sourcepub fn constraint_count(&self) -> usize
pub fn constraint_count(&self) -> usize
Returns the number of distinct constraints violated.
Trait Implementations§
Source§impl<Sc: Clone + Score> Clone for Indictment<Sc>
impl<Sc: Clone + Score> Clone for Indictment<Sc>
Source§fn clone(&self) -> Indictment<Sc>
fn clone(&self) -> Indictment<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 Indictment<Sc>where
Sc: Freeze,
impl<Sc> !RefUnwindSafe for Indictment<Sc>
impl<Sc> Send for Indictment<Sc>
impl<Sc> Sync for Indictment<Sc>
impl<Sc> Unpin for Indictment<Sc>where
Sc: Unpin,
impl<Sc> !UnwindSafe for Indictment<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