pub enum Category {
Outdated,
Yanked,
Vulnerable,
Unsatisfiable,
MutableRefPin,
License,
Deprecated,
Other,
}Expand description
A category a CheckFinding can be classified into — the seven --fail-on tokens FR-009
defines, plus Category::Other.
Other covers a generate_diagnostics finding that matches none of the seven (an
“Unknown package”, a collapsed registry-lookup failure, or a workspace-registry/
offline/dependency-count notice). It is never selectable via --fail-on
(#[value(skip)]) and never matched by FailOnPolicy — it exists purely so
CheckFinding stays a 1:1 mapping of every diagnostic generate_diagnostics produced,
per spec 062 tasks.md T020, rather than silently dropping findings this crate cannot
classify.
Serialize/Deserialize (#1626, manual impls below Self::as_str) produce/accept the
exact same tokens as Self::as_str — used directly as
crate::format::json::FindingDocument::category and as the
crate::format::json::ReportDocument::summary map key, so the JSON wire format never
stringly-types this closed set.
§Examples
use deps_cli::report::Category;
assert_eq!(Category::MutableRefPin.as_str(), "mutable-ref");
assert_eq!(Category::License.as_str(), "license");Variants§
Outdated
A newer version is published for a dependency’s declared requirement.
Yanked
The in-use (or only-satisfying) version has been yanked/retracted.
Vulnerable
A known OSV advisory affects the in-use version.
Unsatisfiable
No published version satisfies the declared requirement.
MutableRefPin
Pinned to a mutable ref (tag/branch) instead of a commit SHA (GitHub Actions/GitLab CI).
License
The resolved license violates the configured allow/deny policy.
Deprecated
The registry reports the package itself as deprecated/abandoned.
Other
A generate_diagnostics finding that does not map to any category above.
Implementations§
Source§impl Category
impl Category
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
The FR-009 wire token for this category (table/json output and --fail-on).
Sourcepub const fn description(self) -> &'static str
pub const fn description(self) -> &'static str
A one-line human-readable description, longer than Self::as_str’s wire token —
used as SARIF rule metadata (crate::format::sarif) for a rule that only has
category-level granularity (no finer diagnostic code). Deliberately close in wording
to each variant’s own doc comment above (both describe the same category, and SARIF’s
shortDescription is meant to read like ordinary documentation prose) rather than a
genuinely distinct text written just to avoid the overlap.
§Examples
use deps_cli::report::Category;
assert_eq!(
Category::Vulnerable.description(),
"A known security advisory affects the in-use version."
);
assert_eq!(
Category::License.description(),
"The resolved license violates the configured allow/deny policy."
);Trait Implementations§
impl Copy for Category
Source§impl<'de> Deserialize<'de> for Category
impl<'de> Deserialize<'de> for Category
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
impl Eq for Category
Source§impl Ord for Category
impl Ord for Category
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Category
impl PartialOrd for Category
impl StructuralPartialEq for Category
Auto Trait Implementations§
impl Freeze for Category
impl RefUnwindSafe for Category
impl Send for Category
impl Sync for Category
impl Unpin for Category
impl UnsafeUnpin for Category
impl UnwindSafe for Category
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§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<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