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 updateRemove Toolchain
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
Install cargo tree (if missing):
π¦ Dependency Management
Dependencies declared in Cargo.toml under [dependencies]:
Update lockfile:
π Updating
Last updated