pub struct Auditor { /* private fields */ }Expand description
Auditor for checking package vulnerabilities
Implementations§
Source§impl Auditor
impl Auditor
Sourcepub fn with_ignored(ignored: Vec<String>) -> Self
pub fn with_ignored(ignored: Vec<String>) -> Self
Create an auditor with ignored vulnerabilities (from CLI)
Sourcepub fn with_config(config: AuditConfig) -> Self
pub fn with_config(config: AuditConfig) -> Self
Create an auditor with full configuration
Sourcepub fn ignore(&mut self, ids: impl IntoIterator<Item = String>)
pub fn ignore(&mut self, ids: impl IntoIterator<Item = String>)
Add vulnerability IDs to ignore
Sourcepub fn effective_ignores(&self) -> Vec<&str>
pub fn effective_ignores(&self) -> Vec<&str>
Get all effective ignored IDs (for reporting)
Sourcepub async fn audit_lockfile(&self, lockfile: &Lockfile) -> Result<AuditReport>
pub async fn audit_lockfile(&self, lockfile: &Lockfile) -> Result<AuditReport>
Audit packages from a lockfile
Sourcepub async fn audit_packages(
&self,
packages: &[(&str, &str)],
) -> Result<AuditReport>
pub async fn audit_packages( &self, packages: &[(&str, &str)], ) -> Result<AuditReport>
Audit a list of packages
Sourcepub async fn generate_fixes(
&self,
report: &AuditReport,
_lockfile: &Lockfile,
) -> Result<Vec<FixRecommendation>>
pub async fn generate_fixes( &self, report: &AuditReport, _lockfile: &Lockfile, ) -> Result<Vec<FixRecommendation>>
Generate fix recommendations for vulnerable packages
Sourcepub async fn apply_fixes(
&self,
fixes: &[FixRecommendation],
lockfile: &Lockfile,
force: bool,
) -> Result<FixResult>
pub async fn apply_fixes( &self, fixes: &[FixRecommendation], lockfile: &Lockfile, force: bool, ) -> Result<FixResult>
Apply fixes by re-resolving dependencies
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Auditor
impl !RefUnwindSafe for Auditor
impl Send for Auditor
impl Sync for Auditor
impl Unpin for Auditor
impl !UnwindSafe for Auditor
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