{"id":"702a9cc2-a6ab-4672-954a-eb28da66167f","shortId":"73wTqM","kind":"skill","title":"rust-dev","tagline":"Practical day-1 guide to building applications in Rust well. Covers the mental model (ownership, errors as values, traits-not-interfaces), day-1 decisions (String vs &str, Box vs Rc vs Arc, dyn vs impl Trait, anyhow vs thiserror), idioms to internalize early, anti-patterns to avo","description":"# Rust Development - Day 1\n\nA practical foundation for writing Rust apps well from the first commit. Not a textbook. Focuses on the differences from other languages, the day-1 decisions that shape everything else, and the small set of crates that cover most real apps.\n\n## When to Use\n\n- Starting a new Rust project (CLI, service, library)\n- Coming to Rust from Python, JavaScript, Go, Java/C#, or C++\n- Choosing between owned/borrowed types, smart pointers, trait objects vs generics\n- Picking error handling strategy (`anyhow` vs `thiserror`)\n- Deciding which crates to reach for\n- Configuring a minimal but opinionated `Cargo.toml`, clippy, and rustfmt\n\n## Day-1 Setup\n\n```bash\n# 1. Install the toolchain (rustup is the toolchain manager)\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n\n# 2. Confirm components (rustfmt and clippy ship with stable, rust-src enables IDE features)\nrustup component add rustfmt clippy rust-src\n\n# 3. Create a project\ncargo new my-app          # binary (src/main.rs)\ncargo new --lib my-lib    # library (src/lib.rs)\n\n# 4. The dev loop (memorize these four)\ncargo check     # fast type-check, no codegen\ncargo run       # build and run (binary)\ncargo test      # build and run tests (incl. doctests)\ncargo clippy    # lint (run before pushing)\ncargo fmt       # format\n\n# 5. Manage dependencies without editing Cargo.toml by hand\ncargo add tokio --features full\ncargo remove tokio\n```\n\n**rust-analyzer is mandatory.** It is the language server every editor uses (VS Code, Zed, Neovim, Helix, RustRover uses its own engine but is comparable). In VS Code, install the `rust-analyzer` extension and set `rust-analyzer.check.command` to `\"clippy\"` so you get lint feedback on save.\n\n**Want a file watcher later?** `cargo install bacon`, then run `bacon` in your project. Not needed on day 1.\n\n## The Rust Mental Model in 5 Ideas\n\nRust trades two things you take for granted in most languages (a garbage collector and exceptions) for compile-time guarantees about memory, data races, and error handling. The shape of the language follows from that trade.\n\n### 1. Ownership: every value has exactly one owner\n\nThink of values like physical objects. A book, a file, a network connection. At any moment, **one variable owns it**. You can:\n\n- **Move it**: `let b = a;` hands ownership to `b`. `a` is gone.\n- **Borrow it immutably**: `&a` lets others look at it. Many readers allowed.\n- **Borrow it mutably**: `&mut a` lets one person modify it. Exclusive access.\n- **Clone it**: `a.clone()` makes a deep copy. Both keep their own.\n\nWhen the owner goes out of scope, the value is dropped (memory freed, file closed, lock released). No GC, no manual `free`. This is RAII, enforced by the compiler.\n\n### 2. Aliasing XOR mutability\n\nAt any moment, a piece of data has **either**:\n- one mutable reference (`&mut T`), **or**\n- any number of immutable references (`&T`),\n\nnever both. This single rule is what eliminates data races and most use-after-free bugs. The borrow checker enforces it. When it complains, it is telling you your data ownership story is unclear, not that the language is being difficult.\n\n### 3. Errors are values, not exceptions\n\nThere is no `try`/`catch`. Functions that can fail return `Result<T, E>`. Functions that can return nothing useful return `Option<T>`. The compiler forces you to handle both. The `?` operator propagates errors up the call stack with one character:\n\n```rust\nfn read_config() -> Result<Config, anyhow::Error> {\n    let bytes = std::fs::read(\"config.toml\")?;   // ? = early-return on Err\n    let config = toml::from_slice(&bytes)?;\n    Ok(config)\n}\n```\n\nThere is no `null`. `Option<T>` is `None` or `Some(value)`. The compiler will not let you forget the `None` case.\n\n### 4. Traits are not Java interfaces\n\nA `trait` defines behavior. Types `impl` traits. So far so familiar. The differences:\n\n- **Static dispatch is the default.** When you write `fn f<T: Display>(x: T)`, the compiler generates a separate copy of `f` for each concrete `T` you call it with (monomorphization, like C++ templates). Zero runtime overhead.\n- **Dynamic dispatch is opt-in** via `dyn Trait` (typically `Box<dyn Trait>` or `&dyn Trait`). One vtable lookup per call.\n- **No inheritance.** Traits compose. If you find yourself reaching for `Deref` to \"extend\" a type, stop and use composition or an enum.\n- **Orphan rule**: you can `impl YourTrait for SomeoneElsesType` or `impl SomeoneElsesTrait for YourType`, but not both foreign. This keeps dependency resolution sane.\n\n### 5. The borrow checker is a design oracle\n\nThe most common newcomer mistake is treating compiler errors as obstacles to silence. They are not. Almost every borrow-check error reveals a real issue with **who owns what**. When you get stuck, the question is rarely \"how do I make this compile\" and almost always \"what is the actual ownership relationship I want here?\" Read the error. The compiler is unusually informative.\n\n## The 3 Questions for Every Function Signature\n\nBefore writing a function, ask: does it need to **own**, **read**, or **modify** the input?\n\n```rust\nfn consume(s: String)        // owns:    function takes responsibility, caller loses it\nfn read(s: &str)             // reads:   function looks at it, caller keeps it\nfn modify(s: &mut String)    // mutates: function changes it in place\n```\n\nDefaults that work 90% of the time:\n- Function parameters: prefer `&str` over `String`, `&[T]` over `Vec<T>` (these are slices, accept both owned and borrowed callers).\n- Function returns: return owned types (`String`, `Vec<T>`). Returning references means lifetimes; avoid until you need them.\n- Struct fields: prefer **owned** types (`String`, `Vec<T>`). Storing `&str` in a struct is the single most common newcomer trap and it cascades lifetime annotations through every type that holds your struct.\n\n## Day-1 Decision Table\n\nOne-line answers to the choices that come up first.\n\n| Decision | Default | When to pick the other |\n|---|---|---|\n| `String` vs `&str` (struct field) | `String` | Almost never `&str` until you have a real reason and understand lifetimes |\n| `String` vs `&str` (function param) | `&str` | Use `String` only if you must own/store it inside |\n| `Vec<T>` vs `&[T]` (param) | `&[T]` | `Vec<T>` only if you must own |\n| `Box<T>` vs `Rc<T>` vs `Arc<T>` | `Box<T>` (single owner, heap) | `Arc<T>` for shared ownership across threads. Avoid `Rc<T>` as default; use `Arc<T>` so you do not refactor when you go async |\n| `RefCell<T>` vs `Mutex<T>` | `Mutex<T>` (or `RwLock<T>`) | Same reason: works in async/threads, while `RefCell` does not |\n| `Option<T>` vs `Result<T, E>` | `Option<T>` for \"no value\", `Result<T, E>` for \"failed for a reason\" | If the absence carries meaning the caller should handle, `Result` |\n| `dyn Trait` vs `impl Trait` / `<T: Trait>` | Generic (`<T: Trait>` or `impl Trait`) - static dispatch | `Box<dyn Trait>` when you need a heterogeneous collection (`Vec<Box<dyn Animal>>`) |\n| Errors in app code | `anyhow::Result<T>` everywhere | - |\n| Errors in library code | `thiserror`-derived enum | Never `Box<dyn Error>` in public library APIs - forces callers to downcast |\n| `&self` vs `&mut self` vs `self` | `&self` for getters, `&mut self` for setters, `self` for builders/consuming ops | - |\n| Module layout | Inline modules until a file gets long, then split | One module = one file is a Java/C# instinct, not a Rust one |\n\n## Idioms to Internalize Early\n\nThese appear in nearly every Rust program. Learn them in week 1.\n\n**`?` for error propagation.** Replaces nine lines of `match` with one character.\n```rust\nlet body = reqwest::get(url).await?.text().await?;\n```\n\n**Iterator chains over manual loops.** Compile to the same machine code as hand-written loops (LLVM inlines closures). Idiomatic Rust is functional in style.\n```rust\nlet active_emails: Vec<String> = users\n    .iter()\n    .filter(|u| u.active)\n    .map(|u| u.email.clone())\n    .collect();\n```\n\n**`match` exhaustiveness.** Add a new variant to an enum and every `match` that does not handle it becomes a compile error. Use this. It is one of the most powerful refactoring tools in any language.\n\n**`if let` and `let else`** for the common single-arm match.\n```rust\nif let Some(name) = user.name { println!(\"hi {name}\"); }\n\nlet Some(name) = user.name else { return Err(anyhow!(\"no name\")); };\n// `name` is in scope from here on, no nesting\n```\n\n**`From` / `Into` for type conversions.** Implement `From`, get `Into` for free. `?` uses `From` to convert error types automatically.\n\n**Combinators on `Option` / `Result`.** Reach for `.map`, `.and_then`, `.unwrap_or`, `.unwrap_or_else`, `.ok_or` before reaching for `match`.\n\n**Derive macros.** `#[derive(Debug, Clone, PartialEq)]` gets you 80% of the boilerplate for free. Add `#[derive(Serialize, Deserialize)]` for JSON.\n\n**Recent sugar (Rust 1.95+).** Two stabilized features worth knowing: `cfg_select!` is a compile-time `match` over `cfg` predicates (replaces most uses of the `cfg-if` crate), and let-chains now work inside `match` arm guards (`match x { Some(v) if let Ok(n) = v.parse::<i32>() => ... }`).\n\n## Coming From X, Here Is What Bites You\n\n**From Python or JavaScript:**\n- `let b = a;` for a heap value (like `String`, `Vec`) **moves** it. `a` is no longer usable. Use `&a` to borrow or `a.clone()` to copy.\n- No null. `Option<T>` is forced on you.\n- No exceptions. `Result<T, E>` and `?`. The compiler will not let you ignore errors.\n- No inheritance. Composition + traits + enums.\n- Variables are immutable by default. Add `mut` to mutate. Same for references: `&` vs `&mut`.\n- Integer types are explicit and indexing requires `usize`.\n\n**From Go:**\n- Errors as values - same instinct, but use `?` instead of `if err != nil`.\n- No `nil`. `Option<T>`.\n- No GC and no goroutines: ownership + borrowing, async/await with `tokio`. The async model is cooperative (`await` is an explicit yield point), not preemptive.\n- `interface{}` becomes traits. Default to generics for static dispatch; `Box<dyn Trait>` only when you need it.\n- Static linking is the default. Binaries are bigger but self-contained.\n- `panic!` should be reserved for unrecoverable bugs in app code; do not use it as Go-style \"log and continue\".\n\n**From Java or C#:**\n- Traits are not interfaces with virtual dispatch by default. `<T: Trait>` is monomorphized. `dyn Trait` is the opt-in dynamic version.\n- No null references. `Option<T>`.\n- No exceptions. `Result<T, E>` and `?`.\n- No class inheritance. Use enums for sum types, traits for shared behavior.\n- No GC: ownership and borrowing decide lifetimes. `Arc<T>` is the closest thing to a Java reference.\n- Generics are monomorphized, not type-erased.\n\n**From C++:**\n- Like RAII, but the borrow checker enforces it at compile time.\n- No copy/move constructors. `Clone` is explicit and `Copy` is a marker trait for cheap bitwise copies.\n- No undefined behavior in safe code (in theory).\n- `&` is a compile-time-checked borrow, not a raw pointer. Raw pointers exist (`*const T`, `*mut T`) but require `unsafe` to dereference.\n- Smart pointers are `Box<T>` (`unique_ptr`), `Rc<T>` (`shared_ptr`, single thread), `Arc<T>` (`shared_ptr`, thread-safe).\n- Macros are hygienic. Procedural macros (derive, attribute, function-like) are how `serde`, `tokio::main`, etc. work.\n\n## The Crate Shortlist\n\nThese cover most real apps. Add them as needed; they are not all required.\n\n| Crate | What it gives you |\n|---|---|\n| `serde` + `serde_json` | Serialization. `#[derive(Serialize, Deserialize)]` and you are done |\n| `tokio` | Async runtime. `#[tokio::main]`, `tokio::spawn`, async I/O |\n| `anyhow` | App error type. `anyhow::Result<T>`, `bail!`, `context()` |\n| `thiserror` | Library error enums. `#[derive(thiserror::Error)]` |\n| `clap` | CLI argument parsing. `#[derive(Parser)]` and you have a CLI |\n| `reqwest` | HTTP client. Async by default, blocking feature available |\n| `tracing` + `tracing-subscriber` | Structured logging. The default for any async code (replaces `log`) |\n| `axum` | Web framework. Built on `tokio` + `hyper` + `tower`. The 2026 default |\n| `sqlx` | Database access. Async, compile-time checked queries. PostgreSQL, MySQL, SQLite |\n| `chrono` | Dates and times. The maintainer announced soft-deprecation in Jan 2026 and recommends `jiff` for new code. `jiff` (BurntSushi) is the successor but still pre-1.0 as of May 2026. Pick `chrono` for `serde`/`sqlx` integration today, `jiff` if you can tolerate pre-1.0 churn |\n\nSee `references/crate-shortlist.md` for one minimal example each.\n\n## Top Anti-Patterns to Avoid\n\nThese are the mistakes that show up in every newcomer's code review. Avoid them.\n\n1. **Storing `&str` (or any reference) in a struct.** Causes lifetime annotations to cascade through every caller. Use `String` until you have a profiler-backed reason not to.\n2. **`Rc<RefCell<T>>` everywhere to simulate Python/JS object semantics.** It works but is a code smell, and breaks the moment you need threading. Default to `Arc<Mutex<T>>` instead so you do not refactor.\n3. **`Box<dyn Error>` in library public APIs.** Forces callers to downcast. Define a typed error enum with `thiserror`. `Box<dyn Error>` is acceptable inside a binary, never in a published library.\n4. **`.unwrap()` and `.expect()` outside prototypes and tests.** Use `?` and propagate. Reserve `unwrap` for truly impossible cases and add a comment explaining why it cannot fail.\n5. **Brute-force `.clone()` until it compiles.** Sometimes cloning is right, but if you are scattering `.clone()` to silence the borrow checker, the design is wrong. Step back and ask the 3 questions about who owns what.\n6. **Trying to inherit via `Deref`**. `Deref` is for smart-pointer-like wrappers, not for OOP-style \"extends\". Use composition.\n7. **Reaching for `unsafe`.** App developers should essentially never need it. `unsafe` does not turn off the borrow checker; it lets you do five specific things (deref raw pointers, call unsafe functions, access mutable statics, implement unsafe traits, access union fields) with the contract that you have manually verified the invariants.\n\n## What to Defer\n\nYou do not need these on day 1. Some you may never need.\n\n- **Lifetimes in struct fields.** Avoid by using owned types. The day you genuinely need them, you will know.\n- **`Pin`, `Future` internals, manual `poll` impls.** Just write `async fn` and `.await`.\n- **`unsafe` and FFI.** Almost never for app code.\n- **Procedural macros.** Library author territory.\n- **Higher-ranked trait bounds (`for<'a>`)**, variance, `PhantomData`. Expert territory.\n- **`Cell`, `OnceCell`, `LazyLock`, `MaybeUninit`.** Reach for these when you have a specific reason.\n\n## Minimal Cargo.toml\n\nSingle-crate, edition 2024, opinionated lints. Drop into a fresh project.\n\n```toml\n[package]\nname = \"my-app\"\nversion = \"0.1.0\"\nedition = \"2024\"\nrust-version = \"1.85\"\n\n[dependencies]\n\n[dev-dependencies]\n\n[profile.release]\nlto = \"thin\"\ncodegen-units = 1\n\n# =============================================================================\n# Lints. Loose-but-helpful: deny obvious bugs, warn on common smells, leave\n# room to learn. Upgrade to clippy::pedantic later if you want the full ride.\n# =============================================================================\n[lints.rust]\nunsafe_code     = \"forbid\"   # downgrade to \"deny\" if you do FFI\nunreachable_pub = \"warn\"\n\n[lints.clippy]\nall = { level = \"deny\", priority = -1 }\n# Idiomatic helpers\n# Note: uninlined_format_args moved to clippy::pedantic (allow-by-default)\n# in mid-2026, so an explicit warn keeps the nudge active.\nuninlined_format_args         = \"warn\"\nsemicolon_if_nothing_returned = \"warn\"\nimplicit_clone                = \"warn\"\n# Smells in non-prototype code\nunwrap_used  = \"warn\"\nexpect_used  = \"warn\"\ndbg_macro   = \"warn\"\ntodo        = \"warn\"\nprint_stdout = \"warn\"   # use `tracing::info!` instead in real apps\n```\n\n## rustfmt.toml\n\n```toml\nstyle_edition = \"2024\"\nedition       = \"2024\"\n```\n\nThat is enough. rustfmt's defaults are good. Some teams add `use_small_heuristics = \"Max\"` to keep more code on single lines. Fancy options like `imports_granularity` and `group_imports` are still nightly-only as of May 2026.\n\n## rust-toolchain.toml (optional but recommended)\n\nPins the toolchain per-project so everyone on the team uses the same Rust.\n\n```toml\n[toolchain]\nchannel    = \"stable\"\ncomponents = [\"rustfmt\", \"clippy\", \"rust-src\"]\nprofile    = \"minimal\"\n```\n\n## .gitignore\n\n```\n/target\n**/*.rs.bk\nCargo.lock      # for libraries only; commit Cargo.lock for binaries\n```\n\n## Project Structure\n\n```\nmy-app/\n  src/\n    main.rs        # binary entry point: fn main()\n    lib.rs         # OR a library crate root\n    config.rs      # module: declared as `mod config;` in main.rs/lib.rs\n    api/           # nested module\n      mod.rs       # OR `api.rs` next to api/ folder (2018+ style preferred)\n      users.rs\n  tests/           # integration tests (each file is its own crate)\n    smoke.rs\n  Cargo.toml\n  Cargo.lock\n  rust-toolchain.toml\n  rustfmt.toml\n  .gitignore\n```\n\nInline modules with `mod { ... }` until a file gets long, then split. Do not pre-split.\n\n## Learning Path\n\n1. **The Rust Book** (https://doc.rust-lang.org/book/) - canonical, free, current. The interactive Brown University version (https://rust-book.cs.brown.edu/) adds quizzes and visualizations.\n2. **Rustlings** (https://github.com/rust-lang/rustlings) - exercises in parallel with The Book.\n3. **100 Exercises to Learn Rust** (https://rust-exercises.com/) - alternative or supplement to Rustlings, slightly newer.\n4. **Rust for Rustaceans** (Jon Gjengset) - the post-beginner book. Read after you are comfortable.\n5. **Zero to Production in Rust** (Luca Palmieri) - if you are building a backend service. Note: the book uses `actix-web` while `axum` is the 2026 default; the patterns translate cleanly.\n\nFor looking up syntax: **Rust by Example** (https://doc.rust-lang.org/rust-by-example/).\n\nFor curated crate recommendations: **blessed.rs** (https://blessed.rs/crates).\n\n## Reference Docs\n\nDetailed material lives in `references/`. Read each when you hit the topic.\n\n- **ownership-and-types.md** - ownership, borrowing, lifetimes, `String`/`&str`/`Cow`, slices, smart pointers, the self-referential struct trap\n- **error-handling.md** - `Result`, `?`, `anyhow` vs `thiserror` patterns, custom error enums, when `panic!` is appropriate\n- **traits-and-generics.md** - traits as bounds, `dyn` vs `impl Trait` vs generics, common derives, `From`/`Into`/`Display`/`Debug`, blanket impls, the orphan rule\n- **async-basics.md** - `tokio`, `#[tokio::main]`, `.await`, `Send`/`Sync`, common pitfalls (blocking in async, `MutexGuard` across `.await`)\n- **crate-shortlist.md** - minimal usage example for each of the 8 crates above","tags":["rust","dev","skills","tenequm","agent-skills","ai-agents","claude-code","claude-skills","clawhub","erc-8004","mpp","openclaw"],"capabilities":["skill","source-tenequm","skill-rust-dev","topic-agent-skills","topic-ai-agents","topic-claude-code","topic-claude-skills","topic-clawhub","topic-erc-8004","topic-mpp","topic-openclaw","topic-skills","topic-solana","topic-x402"],"categories":["skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/tenequm/skills/rust-dev","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add tenequm/skills","source_repo":"https://github.com/tenequm/skills","install_from":"skills.sh"}},"qualityScore":"0.464","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 28 github stars · SKILL.md body (18,789 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:04:39.825Z","embedding":null,"createdAt":"2026-04-30T01:01:54.018Z","updatedAt":"2026-05-18T19:04:39.825Z","lastSeenAt":"2026-05-18T19:04:39.825Z","tsv":"'-1':6,27,81,152,961,2358 '-1.0':1915,1933 '-2026':2375 '/)':2603,2627 '/book/)':2592 '/crates).':2700 '/lib.rs':2538 '/rust-by-example/).':2692 '/rust-lang/rustlings)':2612 '/target':2501 '0.1.0':2294 '1':56,155,332,377,1197,1963,2200,2311,2586 '1.85':2300 '1.95':1393 '100':2620 '2':171,483,1992,2608 '2018':2549 '2024':2279,2296,2427,2429 '2026':1874,1900,1919,2468,2677 '3':194,550,832,2025,2111,2619 '4':213,642,2053,2635 '5':251,338,759,2079,2651 '6':2117 '7':2139 '8':2788 '80':1378 '90':891 'a.clone':445,1472 'absenc':1090 'accept':907,2044 'access':442,1878,2171,2177 'across':1039,2778 'activ':1245,2383 'actix':2671 'actix-web':2670 'actual':817 'add':188,260,1259,1384,1506,1782,2071,2440,2604 'alias':484 'allow':430,2370 'allow-by-default':2369 'almost':783,812,988,2239 'altern':2628 'alway':813 'analyz':269,300 'annot':952,1974 'announc':1894 'answer':967 'anti':49,1944 'anti-pattern':48,1943 'anyhow':41,133,601,1122,1320,1816,1820,2733 'api':1137,2030,2539,2547 'api.rs':2544 'app':63,97,202,1120,1598,1781,1817,2143,2242,2292,2422,2515 'appear':1187 'applic':10 'appropri':2743 'arc':36,1030,1035,1046,1664,1751,2017 'arg':2364,2386 'argument':1833 'arm':1302,1427 'ask':842,2109 'async':1055,1551,1808,1814,1845,1861,1879,2232,2776 'async-basics.md':2765 'async/await':1547 'async/threads':1066 'attribut':1763 'author':2247 'automat':1349 'avail':1850 'avo':52 'avoid':924,1041,1947,1961,2210 'await':1215,1217,1555,2235,2769,2779 'axum':1865,2674 'b':410,415,1451 'back':1988,2107 'backend':2664 'bacon':321,324 'bail':1822 'bash':154 'becom':1274,1564 'beginn':2644 'behavior':651,1656,1711 'bigger':1585 'binari':203,233,1583,2047,2510,2518 'bite':1444 'bitwis':1707 'blanket':2760 'blessed.rs':2697,2699 'blessed.rs/crates).':2698 'block':1848,2774 'bodi':1211 'boilerpl':1381 'book':392,2589,2618,2645,2668 'borrow':419,431,526,761,786,911,1470,1546,1661,1686,1723,2100,2156,2717 'borrow-check':785 'bound':2253,2747 'box':32,706,1026,1031,1109,1117,1133,1572,1743,2026,2042 'break':2009 'brown':2598 'brute':2081 'brute-forc':2080 'bug':524,1596,2319 'build':9,230,236,2662 'builders/consuming':1157 'built':1868 'burntsushi':1908 'byte':604,619 'c':118,691,1614,1681 'call':590,686,714,2168 'caller':862,874,912,1094,1139,1979,2032 'cannot':2077 'canon':2593 'cargo':198,205,220,228,234,242,248,259,264,319 'cargo.lock':2503,2508,2564 'cargo.toml':147,256,2274,2563 'carri':1091 'cascad':950,1976 'case':641,2069 'catch':560 'caus':1972 'cell':2260 'cfg':1399,1408,1416 'cfg-if':1415 'chain':1219,1422 'chang':884 'channel':2490 'charact':594,1208 'cheap':1706 'check':221,225,787,1722,1883 'checker':527,762,1687,2101,2157 'choic':970 'choos':119 'chrono':1888,1921 'churn':1934 'clap':1831 'class':1646 'clean':2682 'cli':106,1832,1841 'client':1844 'clippi':148,176,190,243,306,2330,2367,2494 'clone':443,1374,1696,2083,2088,2096,2394 'close':468 'closest':1667 'closur':1236 'code':281,295,1121,1128,1228,1599,1714,1862,1906,1959,2006,2243,2341,2401,2448 'codegen':227,2309 'codegen-unit':2308 'collect':1115,1256 'collector':353 'combin':1350 'come':109,972,1438 'comfort':2650 'comment':2073 'commit':68,2507 'common':769,945,1299,2322,2754,2772 'compar':292 'compil':358,482,578,633,674,774,810,827,1223,1276,1404,1489,1691,1720,1881,2086 'compile-tim':357,1403,1880 'compile-time-check':1719 'complain':532 'compon':173,187,2492 'compos':718 'composit':733,1498,2138 'concret':683 'config':598,600,615,621,2534 'config.rs':2529 'config.toml':608 'configur':142 'confirm':172 'connect':397 'const':1731 'constructor':1695 'consum':855 'contain':1589 'context':1823 'continu':1610 'contract':2182 'convers':1336 'convert':1346 'cooper':1554 'copi':449,678,1474,1700,1708 'copy/move':1694 'cover':14,94,1778 'cow':2721 'crate':92,138,1418,1775,1791,2277,2527,2561,2695,2789 'crate-shortlist.md':2780 'creat':195 'curat':2694 'curl':164 'current':2595 'custom':2737 'data':363,493,516,538 'databas':1877 'date':1889 'day':5,26,55,80,151,331,960,2199,2216 'dbg':2408 'debug':1373,2759 'decid':136,1662 'decis':28,82,962,975 'declar':2531 'deep':448 'default':665,888,976,1044,1505,1566,1582,1623,1847,1858,1875,2015,2372,2435,2678 'defer':2192 'defin':650,2035 'deni':2317,2345,2356 'depend':253,756,2301,2304 'deprec':1897 'deref':725,2122,2123,2165 'derefer':1739 'deriv':1130,1370,1372,1385,1762,1800,1828,1835,2755 'deseri':1387,1802 'design':765,2103 'detail':2703 'dev':3,215,2303 'dev-depend':2302 'develop':54,2144 'differ':75,660 'difficult':549 'dispatch':662,697,1108,1571,1621 'display':2758 'doc':2702 'doc.rust-lang.org':2591,2691 'doc.rust-lang.org/book/)':2590 'doc.rust-lang.org/rust-by-example/).':2690 'doctest':241 'done':1806 'downcast':1141,2034 'downgrad':2343 'drop':464,2282 'dyn':37,703,708,1098,1626,2748 'dynam':696,1633 'e':568,1075,1082,1486,1643 'earli':47,610,1185 'early-return':609 'edit':255,2278,2295,2426,2428 'editor':278 'either':495 'elimin':515 'els':86,1296,1317,1363 'email':1246 'enabl':183 'enforc':479,528,1688 'engin':289 'enough':2432 'entri':2519 'enum':736,1131,1265,1500,1649,1827,2039,2739 'eras':1679 'err':613,1319,1535 'error':19,130,366,551,587,602,775,788,825,1118,1125,1199,1277,1347,1495,1525,1818,1826,1830,2038,2738 'error-handling.md':2731 'essenti':2146 'etc':1772 'everi':277,379,784,835,954,1190,1267,1956,1978 'everyon':2480 'everyth':85 'everywher':1124,1995 'exact':382 'exampl':1940,2689,2783 'except':355,555,1483,1640 'exclus':441 'exercis':2613,2621 'exhaust':1258 'exist':1730 'expect':2056,2405 'expert':2258 'explain':2074 'explicit':1518,1558,1698,2378 'extend':727,2136 'extens':301 'f':670,680 'fail':564,1084,2078 'familiar':658 'fanci':2452 'far':656 'fast':222 'featur':185,262,1396,1849 'feedback':311 'ffi':2238,2349 'field':930,986,2179,2209 'file':316,394,467,1165,1173,2557,2574 'filter':1250 'find':721 'first':67,974 'five':2162 'fmt':249 'fn':596,669,854,865,877,2233,2521 'focus':72 'folder':2548 'follow':373 'forbid':2342 'forc':579,1138,1479,2031,2082 'foreign':753 'forget':638 'format':250,2363,2385 'foundat':59 'four':219 'framework':1867 'free':475,523,1342,1383,2594 'freed':466 'fresh':2285 'fs':606 'full':263,2337 'function':561,569,836,841,859,870,883,895,913,1003,1240,1765,2170 'function-lik':1764 'futur':2225 'garbag':352 'gc':472,1541,1658 'generat':675 'generic':128,1103,1568,1673,2753 'genuin':2218 'get':309,799,1166,1213,1339,1376,2575 'getter':1150 'github.com':2611 'github.com/rust-lang/rustlings)':2610 'gitignor':2500,2567 'give':1794 'gjengset':2640 'go':115,1054,1524,1606 'go-styl':1605 'goe':457 'gone':418 'good':2437 'goroutin':1544 'grant':347 'granular':2456 'group':2458 'guarante':360 'guard':1428 'guid':7 'hand':258,412,1231 'hand-written':1230 'handl':131,367,582,1096,1272 'heap':1034,1455 'helix':284 'help':2316 'helper':2360 'heterogen':1114 'heurist':2443 'hi':1311 'higher':2250 'higher-rank':2249 'hit':2712 'hold':957 'http':1843 'https':166 'hygien':1759 'hyper':1871 'i/o':1815 'ide':184 'idea':339 'idiom':44,1182 'idiomat':1237,2359 'ignor':1494 'immut':421,505,1503 'impl':39,653,741,746,1101,1105,2229,2750,2761 'implement':1337,2174 'implicit':2393 'import':2455,2459 'imposs':2068 'incl':240 'index':1520 'info':2418 'inform':830 'inherit':716,1497,1647,2120 'inlin':1161,1235,2568 'input':852 'insid':1014,1425,2045 'instal':156,296,320 'instead':1532,2019,2419 'instinct':1177,1529 'integ':1515 'integr':1925,2554 'interact':2597 'interfac':25,647,1563,1618 'intern':46,1184,2226 'invari':2189 'issu':792 'iter':1218,1249 'jan':1899 'java':646,1612,1671 'java/c':116,1176 'javascript':114,1449 'jiff':1903,1907,1927 'jon':2639 'json':1389,1798 'keep':451,755,875,2380,2446 'know':1398,2223 'languag':78,275,350,372,546,1291 'later':318,2332 'layout':1160 'lazylock':2262 'learn':1193,2327,2584,2623 'leav':2324 'let':409,423,436,603,614,636,1210,1244,1293,1295,1306,1313,1421,1434,1450,1492,2159 'let-chain':1420 'level':2355 'lib':207,210 'lib.rs':2523 'librari':108,211,1127,1136,1825,2028,2052,2246,2505,2526 'lifetim':923,951,999,1663,1973,2206,2718 'like':388,690,1457,1682,1766,2129,2454 'line':966,1203,2451 'link':1579 'lint':244,310,2281,2312 'lints.clippy':2353 'lints.rust':2339 'live':2705 'llvm':1234 'lock':469 'log':1608,1856,1864 'long':1167,2576 'longer':1465 'look':425,871,2684 'lookup':712 'loop':216,1222,1233 'loos':2314 'loose-but-help':2313 'lose':863 'lto':2306 'luca':2657 'machin':1227 'macro':1371,1757,1761,2245,2409 'main':1771,1811,2522,2768 'main.rs':2517,2537 'main.rs/lib.rs':2536 'maintain':1893 'make':446,808 'manag':163,252 'mandatori':271 'mani':428 'manual':474,1221,2186,2227 'map':1253,1356 'marker':1703 'match':1205,1257,1268,1303,1369,1406,1426,1429 'materi':2704 'max':2444 'may':1918,2203,2467 'maybeuninit':2263 'mean':922,1092 'memor':217 'memori':362,465 'mental':16,335 'mid':2374 'minim':144,1939,2273,2499,2781 'mistak':771,1951 'mod':2533,2571 'mod.rs':2542 'model':17,336,1552 'modifi':439,850,878 'modul':1159,1162,1171,2530,2541,2569 'moment':400,489,2011 'monomorph':689,1625,1675 'move':407,1460,2365 'must':1011,1024 'mut':434,499,880,1144,1151,1507,1514,1733 'mutabl':433,486,497,2172 'mutat':882,1509 'mutex':1058,1059,2018 'mutexguard':2777 'my-app':200,2290,2513 'my-lib':208 'mysql':1886 'n':1436 'name':1308,1312,1315,1322,1323,2289 'near':1189 'need':329,845,927,1112,1576,1785,2013,2148,2196,2205,2219 'neovim':283 'nest':1331,2540 'network':396 'never':508,989,1132,2048,2147,2204,2240 'new':103,199,206,1261,1905 'newcom':770,946,1957 'newer':2634 'next':2545 'night':2463 'nightly-on':2462 'nil':1536,1538 'nine':1202 'non':2399 'non-prototyp':2398 'none':628,640 'note':2361,2666 'noth':573,2390 'nudg':2382 'null':625,1476,1636 'number':503 'object':126,390,1999 'obstacl':777 'obvious':2318 'ok':620,1364,1435 'oncecel':2261 'one':383,401,437,496,593,710,965,1170,1172,1181,1207,1282,1938 'one-lin':964 'oop':2134 'oop-styl':2133 'op':1158 'oper':585 'opinion':146,2280 'opt':700,1631 'opt-in':699,1630 'option':576,626,1071,1076,1352,1477,1539,1638,2453,2470 'oracl':766 'orphan':737,2763 'other':424 'outsid':2057 'overhead':695 'own':403,795,858,909,916,932,2115,2213 'own/store':1012 'owned/borrowed':121 'owner':384,456,1033 'ownership':18,378,413,539,818,1038,1545,1659,2716 'ownership-and-types.md':2715 'packag':2288 'palmieri':2658 'panic':1590,2741 'parallel':2615 'param':1004,1018 'paramet':896 'pars':1834 'parser':1836 'partialeq':1375 'path':2585 'pattern':50,1945,2680,2736 'pedant':2331,2368 'per':713,2477 'per-project':2476 'person':438 'phantomdata':2257 'physic':389 'pick':129,979,1920 'piec':491 'pin':2224,2473 'pitfal':2773 'place':887 'point':1560,2520 'pointer':124,1727,1729,1741,2128,2167,2724 'poll':2228 'post':2643 'post-beginn':2642 'postgresql':1885 'power':1286 'practic':4,58 'pre':1914,1932,2582 'pre-split':2581 'predic':1409 'preemptiv':1562 'prefer':897,931,2551 'print':2413 'println':1310 'prioriti':2357 'procedur':1760,2244 'product':2654 'profil':1987,2498 'profile.release':2305 'profiler-back':1986 'program':1192 'project':105,197,327,2286,2478,2511 'propag':586,1200,2063 'proto':165 'prototyp':2058,2400 'ptr':1745,1748,1753 'pub':2351 'public':1135,2029 'publish':2051 'push':247 'python':113,1447 'python/js':1998 'queri':1884 'question':802,833,2112 'quizz':2605 'race':364,517 'raii':478,1683 'rank':2251 'rare':804 'raw':1726,1728,2166 'rc':34,1028,1042,1746,1993 'reach':140,723,1354,1367,2140,2264 'read':597,607,823,848,866,869,2646,2708 'reader':429 'real':96,791,995,1780,2421 'reason':996,1063,1087,1989,2272 'recent':1390 'recommend':1902,2472,2696 'refactor':1051,1287,2024 'refcel':1056,1068,1994 'refer':498,506,921,1512,1637,1672,1968,2701,2707 'references/crate-shortlist.md':1936 'referenti':2728 'relationship':819 'releas':470 'remov':265 'replac':1201,1410,1863 'requir':1521,1736,1790 'reqwest':1212,1842 'reserv':1593,2064 'resolut':757 'respons':861 'result':566,599,1073,1080,1097,1123,1353,1484,1641,1821,2732 'return':565,572,575,611,914,915,920,1318,2391 'reveal':789 'review':1960 'ride':2338 'right':2090 'room':2325 'root':2528 'rs.bk':2502 'rule':512,738,2764 'run':229,232,238,245,323 'runtim':694,1809 'rust':2,12,53,62,104,111,181,192,268,299,334,340,595,853,1180,1191,1209,1238,1243,1304,1392,2298,2487,2496,2588,2624,2636,2656,2687 'rust-analyz':267,298 'rust-analyzer.check.command':304 'rust-book.cs.brown.edu':2602 'rust-book.cs.brown.edu/)':2601 'rust-dev':1 'rust-exercises.com':2626 'rust-exercises.com/)':2625 'rust-src':180,191,2495 'rust-toolchain.toml':2469,2565 'rust-vers':2297 'rustacean':2638 'rustfmt':150,174,189,2433,2493 'rustfmt.toml':2423,2566 'rustl':2609,2632 'rustrov':285 'rustup':159,186 'rwlock':1061 'safe':1713,1756 'sane':758 'save':313 'scatter':2095 'scope':460,1326 'see':1935 'select':1400 'self':1142,1145,1147,1148,1152,1155,1588,2727 'self-contain':1587 'self-referenti':2726 'semant':2000 'semicolon':2388 'send':2770 'separ':677 'serd':1769,1796,1797,1923 'serial':1386,1799,1801 'server':276 'servic':107,2665 'set':90,303 'setter':1154 'setup':153 'sh':170 'sh.rustup.rs':169 'shape':84,369 'share':1037,1655,1747,1752 'ship':177 'shortlist':1776 'show':1953 'signatur':837 'silenc':779,2098 'simul':1997 'singl':511,943,1032,1301,1749,2276,2450 'single-arm':1300 'single-cr':2275 'skill' 'skill-rust-dev' 'slice':618,906,2722 'slight':2633 'small':89,2442 'smart':123,1740,2127,2723 'smart-pointer-lik':2126 'smell':2007,2323,2396 'smoke.rs':2562 'soft':1896 'soft-deprec':1895 'someoneelsestrait':747 'someoneelsestyp':744 'sometim':2087 'source-tenequm' 'spawn':1813 'specif':2163,2271 'split':1169,2578,2583 'sqlite':1887 'sqlx':1876,1924 'src':182,193,2497,2516 'src/lib.rs':212 'src/main.rs':204 'ssf':168 'stabil':1395 'stabl':179,2491 'stack':591 'start':101 'static':661,1107,1570,1578,2173 'std':605 'stdout':2414 'step':2106 'still':1913,2461 'stop':730 'store':936,1964 'stori':540 'str':31,868,898,937,984,990,1002,1005,1965,2720 'strategi':132 'string':29,857,881,900,918,934,982,987,1000,1007,1458,1981,2719 'struct':929,940,959,985,1971,2208,2729 'structur':1855,2512 'stuck':800 'style':1242,1607,2135,2425,2550 'subscrib':1854 'successor':1911 'sugar':1391 'sum':1651 'supplement':2630 'sync':2771 'syntax':2686 'tabl':963 'take':345,860 'team':2439,2483 'tell':535 'templat':692 'territori':2248,2259 'test':235,239,2060,2553,2555 'text':1216 'textbook':71 'theori':1716 'thin':2307 'thing':343,1668,2164 'think':385 'thiserror':43,135,1129,1824,1829,2041,2735 'thread':1040,1750,1755,2014 'thread-saf':1754 'time':359,894,1405,1692,1721,1882,1891 'tlsv1.2':167 'today':1926 'todo':2411 'tokio':261,266,1549,1770,1807,1810,1812,1870,2766,2767 'toler':1931 'toml':616,2287,2424,2488 'tool':1288 'toolchain':158,162,2475,2489 'top':1942 'topic':2714 'topic-agent-skills' 'topic-ai-agents' 'topic-claude-code' 'topic-claude-skills' 'topic-clawhub' 'topic-erc-8004' 'topic-mpp' 'topic-openclaw' 'topic-skills' 'topic-solana' 'topic-x402' 'tower':1872 'trace':1851,1853,2417 'tracing-subscrib':1852 'trade':341,376 'trait':23,40,125,643,649,654,704,709,717,1099,1102,1106,1499,1565,1615,1627,1653,1704,2176,2252,2745,2751 'traits-and-generics.md':2744 'traits-not-interfac':22 'translat':2681 'trap':947,2730 'treat':773 'tri':559,2118 'truli':2067 'turn':2153 'two':342,1394 'type':122,224,652,729,917,933,955,1335,1348,1516,1652,1678,1819,2037,2214 'type-check':223 'type-eras':1677 'typic':705 'u':1251,1254 'u.active':1252 'u.email.clone':1255 'unclear':542 'undefin':1710 'understand':998 'uninlin':2362,2384 'union':2178 'uniqu':1744 'unit':2310 'univers':2599 'unreach':2350 'unrecover':1595 'unsaf':1737,2142,2150,2169,2175,2236,2340 'unusu':829 'unwrap':1359,1361,2054,2065,2402 'upgrad':2328 'url':1214 'usabl':1466 'usag':2782 'use':100,279,286,521,574,732,1006,1045,1278,1343,1412,1467,1531,1602,1648,1980,2061,2137,2212,2403,2406,2416,2441,2484,2669 'use-after-fre':520 'user':1248 'user.name':1309,1316 'users.rs':2552 'usiz':1522 'v':1432 'v.parse':1437 'valu':21,380,387,462,553,631,1079,1456,1527 'variabl':402,1501 'varianc':2256 'variant':1262 'vec':903,919,935,1015,1020,1116,1247,1459 'verifi':2187 'version':1634,2293,2299,2600 'via':702,2121 'virtual':1620 'visual':2607 'vs':30,33,35,38,42,127,134,280,294,983,1001,1016,1027,1029,1057,1072,1100,1143,1146,1513,2734,2749,2752 'vtabl':711 'want':314,821,2335 'warn':2320,2352,2379,2387,2392,2395,2404,2407,2410,2412,2415 'watcher':317 'web':1866,2672 'week':1196 'well':13,64 'without':254 'work':890,1064,1424,1773,2002 'worth':1397 'wrapper':2130 'write':61,668,839,2231 'written':1232 'wrong':2105 'x':671,1430,1440 'xor':485 'yield':1559 'yourtrait':742 'yourtyp':749 'zed':282 'zero':693,2652","prices":[{"id":"02104f6e-dc63-4426-8993-04798ebdd6b8","listingId":"702a9cc2-a6ab-4672-954a-eb28da66167f","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"tenequm","category":"skills","install_from":"skills.sh"},"createdAt":"2026-04-30T01:01:54.018Z"}],"sources":[{"listingId":"702a9cc2-a6ab-4672-954a-eb28da66167f","source":"github","sourceId":"tenequm/skills/rust-dev","sourceUrl":"https://github.com/tenequm/skills/tree/main/skills/rust-dev","isPrimary":false,"firstSeenAt":"2026-04-30T01:01:54.018Z","lastSeenAt":"2026-05-18T19:04:39.825Z"}],"details":{"listingId":"702a9cc2-a6ab-4672-954a-eb28da66167f","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"tenequm","slug":"rust-dev","github":{"repo":"tenequm/skills","stars":28,"topics":["agent-skills","ai-agents","claude-code","claude-skills","clawhub","erc-8004","mpp","openclaw","skills","solana","x402"],"license":"mit","html_url":"https://github.com/tenequm/skills","pushed_at":"2026-05-14T18:04:24Z","description":"Agent skills for building, shipping, and growing software products","skill_md_sha":"fd42bfbedcdf5c3735cdcc1bb0eface2877161e4","skill_md_path":"skills/rust-dev/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/tenequm/skills/tree/main/skills/rust-dev"},"layout":"multi","source":"github","category":"skills","frontmatter":{"name":"rust-dev","description":"Practical day-1 guide to building applications in Rust well. Covers the mental model (ownership, errors as values, traits-not-interfaces), day-1 decisions (String vs &str, Box vs Rc vs Arc, dyn vs impl Trait, anyhow vs thiserror), idioms to internalize early, anti-patterns to avoid, and a tight crate shortlist (tokio, serde, anyhow, clap, reqwest, tracing, axum, sqlx). Use when starting a new Rust project, learning Rust coming from Python/JS/Go/Java/C++, deciding on types and lifetimes, choosing crates, structuring modules, configuring Cargo.toml/clippy/rustfmt, or whenever the user mentions Rust, cargo, ownership, borrow checker, lifetimes, traits, async Rust, or \"writing this in Rust\"."},"skills_sh_url":"https://skills.sh/tenequm/skills/rust-dev"},"updatedAt":"2026-05-18T19:04:39.825Z"}}