#[repr(u8)]pub enum Severity {
None = 0,
Low = 1,
Medium = 2,
High = 3,
Critical = 4,
}Expand description
Qualitative severity rating.
| Severity | Score Range |
|---|---|
| None | 0.0 |
| Low | 0.1 - 3.9 |
| Medium | 4.0 - 6.9 |
| High | 7.0 - 8.9 |
| Critical | 9.0 - 10.0 |
§References
- CVSS v3.1 Specification, Section 5: Qualitative Severity Rating Scale
- CVSS v4.0 Specification, Section 6: Qualitative Severity Rating Scale
§Examples
Get Score severity:
// create severity from score
let severity = Severity::from(Score::from(8.7));
// check results
assert_eq!(severity, Severity::High);Compare severities:
let a = Severity::Low;
let b = Severity::High;
// compare severities
assert!(a < b);Variants§
None = 0
None. Score = 0.0.
Low = 1
Low. Score in range [0.1, 3.9].
Medium = 2
Medium. Score in range [4.0, 6.9].
High = 3
High. Score in range [7.0, 8.9].
Critical = 4
Critical. Score in range [9.0, 10.0].
Trait Implementations§
Source§impl Ord for Severity
impl Ord for Severity
Source§impl PartialOrd for Severity
impl PartialOrd for Severity
impl Copy for Severity
impl Eq for Severity
impl StructuralPartialEq for Severity
Auto Trait Implementations§
impl Freeze for Severity
impl RefUnwindSafe for Severity
impl Send for Severity
impl Sync for Severity
impl Unpin for Severity
impl UnwindSafe for Severity
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