pub struct Score {
pub total: i32,
pub factors: Vec<ScoreFactor>,
pub severity: Severity,
pub killed: bool,
pub killed_by: Option<String>,
}Expand description
Risk score with full breakdown
Fields§
§total: i32Final calculated score
factors: Vec<ScoreFactor>Individual factor contributions
severity: SeveritySeverity level based on score
killed: boolWhether this was killed (score <= threshold due to negative factors)
killed_by: Option<String>The factor that killed it (if any)
Implementations§
Source§impl Score
impl Score
pub fn new(factors: Vec<ScoreFactor>) -> Self
Sourcepub fn passes_threshold(&self, threshold: i32) -> bool
pub fn passes_threshold(&self, threshold: i32) -> bool
Check if this score passes the threshold
Sourcepub fn from_total(total: i32) -> Self
pub fn from_total(total: i32) -> Self
Create a score from just a total (for testing)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Score
impl RefUnwindSafe for Score
impl Send for Score
impl Sync for Score
impl Unpin for Score
impl UnwindSafe for Score
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more