cargo-fetch --- Fetch dependencies of a package from the network
cargo fetch
[options]
If a Cargo.lock
file is available, this command will ensure that all of the git dependencies and/or registry dependencies are downloaded and locally available. Subsequent Cargo commands will be able to run offline after a cargo fetch
unless the lock file changes.
If the lock file is not available, then this command will generate the lock file before fetching the dependencies.
If --target
is not specified, then all target dependencies are fetched.
See also the cargo-prefetch plugin which adds a command to download popular crates. This may be useful if you plan to use Cargo without a network with the --offline
flag.
See the reference for details on environment variables that Cargo reads.
0
: Cargo succeeded.101
: Cargo failed to complete.Fetch all dependencies:
cargo fetch