pub struct Advisory {
pub id: String,
pub modified: String,
pub summary: Option<String>,
pub aliases: Vec<String>,
pub severity: VulnSeverity,
pub cvss_vector: Option<String>,
pub fixed_versions: Vec<String>,
pub url: String,
}Expand description
A single vulnerability advisory, converted from OSV’s wire format at the crate boundary.
§Examples
use deps_core::osv::{Advisory, VulnSeverity};
let advisory = Advisory {
id: "RUSTSEC-2020-0071".to_string(),
modified: "2023-01-01T00:00:00Z".to_string(),
summary: Some("Potential segfault in the time crate".to_string()),
aliases: vec!["CVE-2020-26235".to_string()],
severity: VulnSeverity::High,
cvss_vector: None,
fixed_versions: vec!["0.2.23".to_string()],
url: "https://osv.dev/vulnerability/RUSTSEC-2020-0071".to_string(),
};
assert_eq!(advisory.fixed_versions.last(), Some(&"0.2.23".to_string()));Fields§
§id: StringAdvisory identifier (e.g. "RUSTSEC-2020-0071", "GHSA-...").
modified: StringRFC3339 last-modified timestamp — the crate::osv::OsvClient record-cache validator.
summary: Option<String>Human-readable one-line summary, if OSV provided one.
aliases: Vec<String>Alternate identifiers (CVE, GHSA, …).
severity: VulnSeverityDerived severity bucket.
cvss_vector: Option<String>Raw CVSS vector string, shown verbatim in hover but never parsed.
fixed_versions: Vec<String>All fixed events found in the record’s ranges, ascending. May be
empty if OSV recorded no fix. The highest entry is the one to surface
as “the fix” — see architecture.md §6 for why the first one is not.
url: Stringhttps://osv.dev/vulnerability/{id}.
Trait Implementations§
impl Eq for Advisory
impl StructuralPartialEq for Advisory
Auto Trait Implementations§
impl Freeze for Advisory
impl RefUnwindSafe for Advisory
impl Send for Advisory
impl Sync for Advisory
impl Unpin for Advisory
impl UnsafeUnpin for Advisory
impl UnwindSafe for Advisory
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.