pub struct Scores {
pub base: Score,
pub temporal: Option<Score>,
pub environmental: Option<Score>,
}Expand description
Base, temporal, and environmental scores for a CVSS v2 vector.
You can convert a Scores structure to an overall vector
Score with Score::from().
See CVSS v2.0 Documentation, Section 3. Scoring.
§Example
Get base score for CVSS v2 vector:
// parse CVSS v2 vector string
let v: Vector = "AV:N/AC:L/Au:N/C:N/I:N/A:C".parse()?;
// get scores
let scores = Scores::from(v);
// check result
assert_eq!(scores.base, Score::from(7.8));Convert Scores to an overall Score:
let scores = Scores {
base: Score::from(4.3),
temporal: Some(Score::from(3.2)),
environmental: Some(Score::from(1.5)),
};
// convert to overall score
let score = Score::from(scores);
// check result
assert_eq!(score, Score::from(1.5));Fields§
§base: ScoreBase Score.
temporal: Option<Score>Temporal Score. Will have a value of None if no Temporal
metrics are defined.
See CVSS v2.0 Documentation, Section 3.2.2. Temporal Equation.
environmental: Option<Score>Environmental Score. Will have a value of None if no Temporal
metrics are defined.
See CVSS v2.0 Documentation, Section 3.2.3. Environmental Equation.
Trait Implementations§
impl Copy for Scores
impl Eq for Scores
impl StructuralPartialEq for Scores
Auto Trait Implementations§
impl Freeze for Scores
impl RefUnwindSafe for Scores
impl Send for Scores
impl Sync for Scores
impl Unpin for Scores
impl UnwindSafe for Scores
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