Cargo verwenden
Wenn du anfĂ€ngst ĂŒber Rust zu lesen, wirst du sehr bald Cargo, ein Standardwerkzeug, welches im Rust-Ăkosystem verwendet wird, um Rust-Anwendungen zu erstellen und auszufĂŒhren, kennenlernen. Hier wollen wir einen kurzen Ăberblick geben, was Cargo ist und wie es in das breitere Ăkosystem und in dieses Training passt.
Installation
Please follow the instructions on https://rustup.rs/.
This will give you the Cargo build tool (cargo
) and the Rust compiler (rustc
). You will also get rustup
, a command line utility that you can use to install to different compiler versions.
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