What is Rust Max?
Rust Max,
also known by its crate name rmx
,
is a collection of crates, tools, and documentation
for the Rust programming language.
Rust is a modern systems programming language that is extremely fast and does not crash. It is suitable for development of high-performance, low-level software as in operating systems, databases, and distributed systems; as well as cli, web, device, and application development.
Rust Max is a comprehensive guide to the Rust ecosystem
for new and old Rust programmers,
including a "batteries-included" supercrate
of selected high-quality Rust libraries:
rmx
.
Rust Max is not an official Rust project.
Rust mastery awaits
- Step 1: Install Rust with
rustup
. - Step 2: Learn Rust from The Rust Max Library.
- Step 3: Build programs with Rust crates.
- Step 4: Maintain programs with Rust tools.
Rust Max addons
todo
Easy Mode Rust
Starting a project
Updating dependencies in lockfile
cargo update
Updating dependencies in Cargo.toml
cargo upgrade
With no extra arguments cargo upgrade
modifies
Cargo.toml
files such that the dependencies are
set to their latest compatible versions.
In this way it similar to cargo update
but for manifests
instead of lockfiles.
todo This command is from the cargo-edit
package.
Upgrading dependencies across minor versions in Cargo.toml
cargo upgrade --incompatible
topics
- anyhow, thiserror
rustup
Installation
Rust is installed with the rustup
tool.
Linux, Mac OS, and Unixes
run the following in your shell then follow the onscreen instructions:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Windows for 64-bit x86_64
download and run rustupβinit.exe then follow the onscreen instructions.
Windows for 32-bit i686
download and run rustupβinit.exe then follow the onscreen instructions.
Rust Max: Crates
Rust Max: Tools
- Standard Rust tools:
cargo
rustc
rustup
rustdoc
rustfmt
clippy
just
mdbook
bindgen
miri
- Cargo plugins:
cargo-edit
cargo-clean-all
cargo-deny
cargo-license
cargo-audit
cargo-generate
- More Rust tools:
clippy-control
- More tools:
ripgrep
tokei
basic-http-server
gist
jaq
jsonxf
fd
sd
todo say something here
Standard Rust tools
π¦ cargo
The Rust build and packaging tool.
It is the central tool in most Rust development workflows.
It is part of every Rust toolchain,
usually managed by rustup
.
ποΈ The
cargo
Book
π¦ rustc
π¦ rustup
π¦ rustfmt
π¦ mdbook
π¦ bindgen
π¦ miri
Cargo plugins
π¦ cargo-edit
Extra cargo
subcommands for editing Cargo.toml
.
cargo install cargo-edit
π₯‘
crates.io
Page
ποΈ Source Repository
Installing cargo-edit
provides two cargo
subcommands:
cargo add
was once provided by cargo-edit
but since Rust 1.62.0
is built into cargo
itself.
π¦ cargo-clean-all
π¦ cargo-deny
π¦ cargo-license
π¦ cargo-audit
π¦ cargo-generate
More Rust-specific tools
π¦ clippy-control
More Rust tools
π¦ ripgrep
π¦ just
π¦ tokei
π¦ basic-http-server
π¦ gist
π¦ jaq
π¦ jsonxf
π¦ fd
π¦ sd
The Rust Max Library
The Rust language and its ecosystem is documented in "books"
(rendered with mdbook
), and most of these links are to books.
Links with a bookmark icon, π, are to particularly notable or useful chapters within a book.
The Rust language
- The Rust Programming Language (The Book)
- Rust By Example
- The Rust Reference
- π Conditional compilation. Including which cfgs are set by rustc.
- π Behavior considered undefined
- The Rustonomicon
- The Rust Edition Guide
- The Little Book of Rust Macros
- Rust API Guidelines
- Rust Unsafe Code Guidelines
- Rust Error Codes Index
- The Rust Unstable Book
- The Rust Style Guide
- Rust Release Notes
The Rust standard library
std
- π
std::collections
- π
std::error
- π
std::ptr
. Safety, undefined behavior, and "provenance". - π
std::sync
- π
std::sync::atomic
- π
core
alloc
proc_macro
Standard Rust tools
- The
cargo
Book- π The manifest format
- π Environment variables that affect the Cargo build process.
- π Configuration format. Cargo has many interesting configuration options.
- The
rustc
Book - The
rustup
Book - The
rustdoc
Book - rustfmt (todo)
- The
clippy
Book - The
just
Programmer's Manual - The
mdbook
Book - The
bindgen
User Guide - miri (todo)
The Rust crate ecosystem
Domain-specific Rust
The Rust Project internals
- Rust Project Goals
- Guide to
rustc
Development - Standard Library Developers Guide
- Rust Forge
- Rust RFCs
Rust Max Addons
The Rust Standard Library Revisited
The Rust Standard Library contains many important tools. Much of its documentation is excellent, but some, including the Tour of the Rust Standard Library, has bitrotted.
API docs
Rust standard library classics
Some of the Rust standard library documentation is excellent, with good overviews of systems programming topics generally.
- π
std::collections
- π
std::error
- π
std::sync
- π
std::sync::atomic
A (New) Tour of the Rust standard library
todo
The Rust Ecosystem
Rust resources
Error handling - anyhow
and thiserror
Serialization - serde
Command line handling - clap
Derive all the things
Logging - log
and env_logger
crate::env_logger::Builder::new()
.filter_level(log::LevelFilter::Info)
.parse_default_env()
.init();
Async I/O - tokio
Managing Rust toolchains
Procedural macros
Rust build scripts
todo topics
cargo add
cargo update
cargo upgrade
- lockfiles
How Do I β¦ in Rust?
Discovery
β¦ find a crate for a given purpose?
β¦ find the latest version of a crate?
Project organization
β¦ organize a Rust workspace?
Conveniences
β¦ define "extension" methods on a type in another crate?
β¦ guarantee a trait is object-safe?
static_assertions::assert_obj_safe!(MyTrait);
Error handling and debugging
β¦ handle errors simply and correctly?
β¦ structure errors in a public API?
β¦ set up basic logging?
Collections
β¦ create a fast HashMap
?
β¦ convert from slices to fixed-length arrays?
Numerics
β¦ convert between numeric types ideomatically?
β¦ perform math ideomatically?
β¦ convert between ints and bytes?
Encoding, serialization, parsing
β¦ serialize to and from JSON?
β¦ decide what format to use with serde
?
Time
β¦ parse and render standard time formats?
Random numbers
β¦ generate a strong random number?
β¦ generate a strong random number from a seed?
β¦ generate a fast random number from a seed?
Cryptography
β¦ calculate a cryptographic content hash?
Parallelism and Concurrency
β¦ initialize a global value?
todo LazyLock
, OnceLock
, and Once
.
β¦ send messages to/from async code?
todo futures::channels
Asynchronous I/O
β¦ set up the tokio
event loop?
β¦ stub an unwritten async fn
?
Networking and web
β¦ make a synchronous HTTP request?
β¦ configure a basic HTTP server?
Text / unicode
Terminal / CLI
β¦ set up a simple CLI parser with subcommands?
β¦ display colors in the terminal?
β¦ read line-based input from the terminal?
System / OS
β¦ read environment variables?
β¦ work with a temporary file?
β¦ work with multiple files in a temporary directory?
Testing
β¦ create a custom test harness?
β¦ create a custom table-based test harness?
Build scripts
β¦ write build scripts ideomatically?
β¦ link to a native static library?
β¦ compile and link a C source file?
FFI / interop
β¦ create Rust bindings to a C/C++ program?
Procedural macros
let else
topics
- justfiles
- time - jiff vs chrono vs time
- xtask and xshell
- project organization
- extension_trait
- global initialization - lazy_static vs once_cell vs std
- lazy_static -> LazyLock
- lazy_static can be used with a spin lock
- OnceLock is in std
- error handling
- ideomatic casting
- ideomatic math
The Rust Max Radar
This is where we collect crates and tools of interest, but that are not yet part of Rust Max.
Crates
backtrace-on-stack-overflow
. Nice missing feature, but code looks underdeveloped.bitvec
. Operate directly on bits.boringtun
. WireGuard.comrak
. Markdown parser.console
,dialoguer
, andindicatif
. Pretty terminals.criterion
. Advanced benchmarking.dashmap
. Concurrent hash map.datatest-stable
Data-driven tests.dotenv
.derive-new
Derive thenew
function.ena
. The union find algorithm.encoding
,charset
,codepage
,oem_cp
,icu_normalizer
,detone
. Text encoding.enum-iterator
. Iterate over variants.eyre
. Sophisticated error handling.flate2
.fnv
or some other non-ahash fast hashhashbrown
. Hash maps with no-std.home
ignore
. Likewalkdir
but obeys.gitignore
.include_dir
.indexmap
libm
. Useful for no-std.memchr
memmap
ndarray
nix
notify
. File system notification.num
.num-traits
ordered-float
parking_lot
Non-poisoning mutexes, etc.petgraph
ratatui
. Seriously cool CLIs.rangetools
rustls
. TLS.rustversion
rust-embed
. Embedding of file system resources into binaries, with hot-reloading during development.scopeguard
. Likedefer
.smallvec
. The "small vector" optimization. There may be better / newer options.sqlx
.tar
.tungstenite
. WebSockets.stacker
. Manually-growable call stacks.time
. Another time crate.tracing
.tracing-subscriber
.tracing-tracy
.unicode-xid
.xdg
Tools
Wanted
- SHA3
- gRPC
- wasm crates and tools, wasm-bindgen, stdweb
- threadpool
- zip, gzip
- parser generator (pest?)
- alternative to bitflags
- gui stuff
- winit, wgpu vs glow, morphorm, css, iced vs egui
- i18n
- QUIC - either quinn or quiche
- HTTP3
- markdown
- csv
- small string, smartstring
- rational numbers
- fixed-point, decimal numbers, rust-decimal
Replacements
- num_cpu -> std::thread::available_parallelism
Graveyard
These projects were once useful or notable, but are now deprecated by others.
lazy_static
. Usestd::sync::LazyLock
.once_cell
. Usestd::sync::OnceLock
.
External Rust Resources
These are not part of Rust Max.
Must know URLS π€―
Tier 1 - looks good π
- Rust Language Cheat Sheet. This looks awesome.
- Rust Component History.
rustup
toolchain status. Look here to figure out if your nightly toolchain had component build failures. - The Little Book of Rust Books
- "Can I Use _?"
Tier 2 - unvetted π
- Rust String Conversions Cheat Sheet
- Rust Iterator Cheat Sheet
- Rust Container Cheet Sheet
- Lib.rs
- Secure Rust Guidelines.
- List of security-related projects
- Tour of Rust's standard library traits
- Another Container Cheet Sheet
todo
- rust-lang.org
- play.rust-lang.org
- rustup.org
- crates.io
- std.rs
- docs.rs
- query.rs
- social and forums
- releases.rs