pub struct ScanScore {
pub score: i32,
pub grade: &'static str,
}Expand description
The computed score and letter grade for a scan.
Fields§
§score: i32§grade: &'static strImplementations§
Source§impl ScanScore
impl ScanScore
Sourcepub fn calculate(results: &[AnalysisResult]) -> Self
pub fn calculate(results: &[AnalysisResult]) -> Self
Calculate the score from a set of analysis results using the two-round HTTP Observatory method:
- Round 1: penalties are deducted from the baseline of 100.
- Round 2: bonuses are added only if the round-1 score is >= 90.
Final score is clamped to [0, 145].
pub fn grade(score: i32) -> &'static str
Trait Implementations§
impl StructuralPartialEq for ScanScore
Auto Trait Implementations§
impl Freeze for ScanScore
impl RefUnwindSafe for ScanScore
impl Send for ScanScore
impl Sync for ScanScore
impl Unpin for ScanScore
impl UnsafeUnpin for ScanScore
impl UnwindSafe for ScanScore
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