استفاده از cargo

When you start reading about Rust, you will soon meet Cargo, the standard tool used in the Rust ecosystem to build and run Rust applications. Here we want to give a brief overview of what Cargo is and how it fits into the wider ecosystem and how it fits into this training.

راهنمای نصب

Please follow the instructions on https://rustup.rs/.

با این کار به شما ابزار ساخت Cargo (cargo) و کامپایلر Rust (rustc) را می دهد. شما همچنین rustup را دریافت خواهید کرد، یک ابزار خط فرمان که می توانید از آن برای نصب نسخه های مختلف کامپایلر استفاده کنید.

After installing Rust, you should configure your editor or IDE to work with Rust. Most editors do this by talking to rust-analyzer, which provides auto-completion and jump-to-definition functionality for VS Code, Emacs, Vim/Neovim, and many others. There is also a different IDE available called RustRover.

  • On Debian/Ubuntu, you can also install Cargo, the Rust source and the Rust formatter via apt. However, this gets you an outdated rust version and may lead to unexpected behavior. The command would be:

    sudo apt install cargo rust-src rustfmt