pub struct VulnerabilityDatabase { /* private fields */ }Expand description
Database of known vulnerability advisories.
Implementations§
Source§impl VulnerabilityDatabase
impl VulnerabilityDatabase
Sourcepub fn add_advisory(&mut self, advisory: VulnerabilityAdvisory)
pub fn add_advisory(&mut self, advisory: VulnerabilityAdvisory)
Add an advisory to the database.
Sourcepub fn check_package(
&self,
name: &str,
version: &str,
) -> Vec<&VulnerabilityAdvisory>
pub fn check_package( &self, name: &str, version: &str, ) -> Vec<&VulnerabilityAdvisory>
Check whether an installed package has known vulnerabilities.
Uses simple equality matching on the package name and substring matching on the version range string.
Sourcepub fn check_installed<'a>(
&'a self,
installed: &'a [(String, String)],
) -> Vec<(&'a str, &'a VulnerabilityAdvisory)>
pub fn check_installed<'a>( &'a self, installed: &'a [(String, String)], ) -> Vec<(&'a str, &'a VulnerabilityAdvisory)>
Batch-check a set of installed packages.
Takes (name, version) pairs and returns matching advisories together
with the affected package name.
Sourcepub fn advisory_count(&self) -> usize
pub fn advisory_count(&self) -> usize
Total number of advisories in the database.
Sourcepub fn critical_count(&self) -> usize
pub fn critical_count(&self) -> usize
Number of Critical-severity advisories.
Trait Implementations§
Source§impl Clone for VulnerabilityDatabase
impl Clone for VulnerabilityDatabase
Source§fn clone(&self) -> VulnerabilityDatabase
fn clone(&self) -> VulnerabilityDatabase
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VulnerabilityDatabase
impl Debug for VulnerabilityDatabase
Auto Trait Implementations§
impl Freeze for VulnerabilityDatabase
impl RefUnwindSafe for VulnerabilityDatabase
impl Send for VulnerabilityDatabase
impl Sync for VulnerabilityDatabase
impl Unpin for VulnerabilityDatabase
impl UnwindSafe for VulnerabilityDatabase
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)