pub struct Spec<V: 'static> {
pub ecosystem: &'static str,
pub range_type: &'static str,
pub parse_version: fn(&str) -> Option<V>,
pub normalize_name: fn(&str) -> String,
pub use_versions: bool,
pub severity: fn(&OsvRecord) -> (Severity, Option<f32>),
}Expand description
The per-ecosystem knobs the generic load/advisories_from need. Everything else
(wire schema, parallel reader, indexing, parse-once) is shared.
Fields§
§ecosystem: &'static strThe OSV affected[].package.ecosystem string this feeder consumes (e.g. "Maven").
range_type: &'static strThe OSV range type this feeder evaluates ("ECOSYSTEM" or "SEMVER"); other types
are not matchable.
parse_version: fn(&str) -> Option<V>Parse a bound/version string with this ecosystem’s version adapter (incl. its "0"
convention). Used at load to pre-parse range bounds and the enumerated versions.
normalize_name: fn(&str) -> StringNormalize a package name into the index key (identity, lowercase, PEP 503, URL, …).
use_versions: boolWhether to collect the enumerated versions list (false for npm, which is range-only).
severity: fn(&OsvRecord) -> (Severity, Option<f32>)Derive (severity, cvss_score) from a record. default_severity suits every feeder
whose records carry the GHSA band / CVSS_V3 vector; npm passes its own.
Auto Trait Implementations§
impl<V> Freeze for Spec<V>
impl<V> RefUnwindSafe for Spec<V>
impl<V> Send for Spec<V>
impl<V> Sync for Spec<V>
impl<V> Unpin for Spec<V>
impl<V> UnsafeUnpin for Spec<V>
impl<V> UnwindSafe for Spec<V>
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> 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