pub struct Fixer { /* private fields */ }
Expand description
Auto-fixer for vulnerable dependencies
Implementations§
Source§impl Fixer
impl Fixer
Sourcepub fn new(
cargo_lock: Lockfile,
cargo_toml: Option<PathBuf>,
path_to_cargo: Option<PathBuf>,
) -> Self
pub fn new( cargo_lock: Lockfile, cargo_toml: Option<PathBuf>, path_to_cargo: Option<PathBuf>, ) -> Self
Create a new Fixer
for the given Cargo.lock
file
path_to_cargo
defaults to cargo
, resolved in your $PATH
.
If the path to Cargo.toml
is not specified, the cargo update
command
will be run in the directory with the Cargo.lock
file.
Leaving it blank will fix the entire workspace.
Sourcepub fn get_fix_command(
&self,
vulnerability: &Vulnerability,
dry_run: bool,
) -> Command
pub fn get_fix_command( &self, vulnerability: &Vulnerability, dry_run: bool, ) -> Command
Returns a command that calls cargo update
with the right arguments
to attempt to fix this vulnerability.
Note that the success of the command does not mean the vulnerability was actually fixed! It may remain if no semver-compatible fix was available.
Auto Trait Implementations§
impl Freeze for Fixer
impl RefUnwindSafe for Fixer
impl Send for Fixer
impl Sync for Fixer
impl Unpin for Fixer
impl UnwindSafe for Fixer
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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