pub trait AdvisorySource {
// Required methods
fn name(&self) -> &'static str;
fn query(&self, components: &[Component]) -> Result<Vec<Advisory>>;
}Expand description
An advisory database that can be queried for the vulnerabilities affecting a set of components.
An implementation returns Ok(advisories) when the source answered (an empty vector means “no
advisories”), and Err when the source could not be reached — an unreachable endpoint, a
network error, or an unusable response. run_audit records those failures in
AuditReport::failed_sources so a caller can distinguish an incomplete audit from a clean one;
a single failing source still never sinks the run.
Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
A short, stable name ("npm", "osv", …) used in Advisory::source and diagnostics.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".