Rust
Install Rust using rustup, manage toolchains, and verify cargo for local development before deploying to Discloud.
🧾 Overview
Rust provides performance, memory safety, and predictable resource usage for APIs, workers, and bots. Install with rustup to manage toolchains locally before deploying.
📥 Installation (choose your OS)
Install via rustup script:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
rustc --version
cargo --versionAdd Build Essentials (Debian/Ubuntu)
sudo apt update
sudo apt install -y build-essential pkg-config libssl-devUpdate
rustup updateUninstall Rust (rustup and all toolchains)
rustup self uninstallInstall with rustup:
Add build tools (if not present):
Update:
🧰 Toolchains & Components
1
List installed
rustup toolchain list2
Add nightly (optional)
rustup toolchain install nightly3
Set default
rustup default stable4
Add components (example)
rustup component add clippy rustfmt🗂 Project Init
Create new project:
Run:
Format & lint:
🗃 Common Cargo Commands
📦 Dependency Management
Dependencies declared in Cargo.toml under [dependencies]:
Update lockfile:
🔄 Updating
Last updated