All Guides

Rust und Cargo Einrichtung

Installieren Sie Rust und den Cargo-Paketmanager.

Intermediate15 Min.

Setup Steps

1. Install Rust with rustup:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

2. Reload your shell:

source $HOME/.cargo/env

3. Check versions:

rustc --version
cargo --version

4. Create a new project:

cargo new project_name
cd project_name

5. Project structure:

project_name/
  src/main.rs
  Cargo.toml

6. Compile and run:

cargo run

7. Release build:

cargo build --release

8. Add dependencies (Cargo.toml):

[dependencies]
serde = { version = "1.0", features = ["derive"] }
reqwest = { version = "0.12", features = ["json"] }
tokio = { version = "1", features = ["full"] }

9. Install packages:

cargo build

10. Run tests:

cargo test

11. Update Rust:

rustup update