cargo
Rust cargo fetch
Prepare dependency sources ahead of a disconnected build. For registry or Git packages, fetch may contact their configured servers; it does not install a target toolchain or native linker. Example format: shell; run from a disposable copy of v15/fixtures/projects/local-app. Expected result (not executed): Exit zero for the local-only graph; no network dependency to download. Why: All dependency sources are already local. Common mistake: Assuming fetch compiles the program or guarantees an offline build on another computer.
Formal Syntax & Structure
rust syntaxrust
cargo fetch [OPTIONS]Working Example
Example Snippetrust
cargo fetch --offline