pub enum Severity {
Error,
Warning,
Note,
}Expand description
The severity vocabulary a Diagnostic may carry.
One definition, because there were two and they disagreed: assay-cli matched
case-insensitively and emitted warn, assay-core’s SARIF builder matched
exactly and emitted warning (#2033). A value spelled Warning reached exit
classification as a warning and Code Scanning as a note.
Variants§
Implementations§
Source§impl Severity
impl Severity
Sourcepub fn parse(value: &str) -> Option<Self>
pub fn parse(value: &str) -> Option<Self>
Parse a severity, or None when the value is not in the vocabulary.
None rather than a default on purpose. Both previous implementations
ended in an unconditional fallback to the least severe level, so a
misspelled or newly introduced severity dropped out of the error set and
could turn a failing run into exit 0 (#2025). An unrecognized severity is
not a note; it is unknown, and callers must decide deliberately.
Sourcepub fn as_cli_str(self) -> &'static str
pub fn as_cli_str(self) -> &'static str
The spelling the CLI uses in its own output and comparisons.
Sourcepub fn as_sarif_level(self) -> &'static str
pub fn as_sarif_level(self) -> &'static str
The SARIF level, which spells warnings differently from the CLI.
Trait Implementations§
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 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> 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<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