#[non_exhaustive]pub enum Severity {
Info,
Low,
Medium,
High,
Critical,
}Expand description
Severity of a security finding.
Ordered from least to most severe. Supports comparison:
Severity::Critical > Severity::High is true.
§Examples
use secfinding::Severity;
assert!(Severity::Critical > Severity::High);
assert_eq!(Severity::try_from("medium"), Ok(Severity::Medium));§Thread Safety
Severity is Send and Sync.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Info
Informational - no security impact, useful context.
Default so structs that derive Default and contain a
Severity field get the safest possible initial classification:
do-no-harm, no escalation pressure.
Low
Low - minor issue, unlikely to be exploitable alone.
Medium
Medium - real risk, exploitable under certain conditions.
High
High - serious vulnerability, likely exploitable.
Critical
Critical - immediate risk, trivially exploitable.
Implementations§
Source§impl Severity
impl Severity
Sourcepub fn from_str_loose(s: &str) -> Option<Severity>
pub fn from_str_loose(s: &str) -> Option<Severity>
Parse from a case-insensitive string.
Returns None for unrecognized values.
Sourcepub fn sarif_level(self) -> &'static str
pub fn sarif_level(self) -> &'static str
SARIF level string.
Sourcepub fn meets(self, minimum: Severity) -> bool
pub fn meets(self, minimum: Severity) -> bool
true when self is at or above the supplied minimum
threshold. The shared “min-severity gate” semantic every
scanner CLI implements (--min-severity high); kept here so
every consumer agrees on the comparison direction without
each crate re-implementing it (those re-implementations
flipped Info between lowest and highest, which is the
correctness bug behind the consolidation audit).
use secfinding::Severity;
assert!(Severity::Critical.meets(Severity::High));
assert!(!Severity::Low.meets(Severity::High));
assert!(Severity::High.meets(Severity::High));Trait Implementations§
impl Copy for Severity
Source§impl<'de> Deserialize<'de> for Severity
impl<'de> Deserialize<'de> for Severity
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Severity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Severity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for Severity
Source§impl Ord for Severity
impl Ord for Severity
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Severity
impl PartialOrd for Severity
Source§impl Serialize for Severity
impl Serialize for Severity
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl SeverityVisuals for Severity
impl SeverityVisuals 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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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