rust-cookbook
This skill contains shell command directives (!`command`) that may execute system commands. Review carefully before installing.
Rust Cookbook
Idiomatic recipes for common Rust tasks, adapted from Cookin' with Rust. Each recipe is task → crate → pattern. This skill is the broad index; where a dedicated skill exists (reqwest-rust, clap-rust, tokio-rust, anyhow-rust, walkdir-rust, tempfile-rust, clickhouse, rocksdb, sui-sdk-js...), defer to it for depth.
How to use
- Find the task category below.
- Use the crate named — these are the cookbook's current, battle-tested choices. Confirm the latest version on
crates.io/docs.rsbefore pinning. - Adapt the pattern. Prefer returning
anyhow::Result<T>from fallible recipe code and propagating with?(seeanyhow-rust).
Crate baseline:
regex 1.12,semver 1.0,num 0.4,chrono 0.4, rand 0.9 (rand::rng()), clap 4 (Command/derive). These recipes assume a recent toolchain —std::sync::LazyLock/LazyCell(used below overlazy_static) need Rust 1.80+, and rand 0.9 droppedthread_rng()/gen_range. Check your MSRV before pinning; on older toolchains fall back tolazy_static/once_celland rand 0.8 APIs.