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)

1

Download the installer: https://win.rustup.rs/ (or run command below in PowerShell)

2

Run and accept defaults (installs to user profile).

Verify

rustc --version
cargo --version

Update Toolchain

rustup update

🧰 Toolchains & Components

1

List installed

rustup toolchain list
2

Add nightly (optional)

rustup toolchain install nightly
3

Set default

rustup default stable
4

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