Onboarding
Install a crate. Copy a utility. Use the CLI.
Start with a Cargo crate, copy a utility you want to own, or use the CLI for guided discovery and adoption.
RustUse organizes focused Rust utility crates into composable facades. Each crate stands on its own, while each facade gives related utilities a broader entry point.
You can use RustUse in three ways: install Cargo crates from crates.io, copy utilities into your codebase, or use the rustuse CLI for guided adoption.
The goal is the same in every mode: choose the narrowest surface that solves the problem, then compose outward only when a broader entry point makes your codebase clearer.
Three ways to use RustUse
Section titled “Three ways to use RustUse”RustUse supports three adoption paths. No path is the only correct one. They represent different ownership and update boundaries.
| Path | Best when | Boundary |
|---|---|---|
| Cargo | You want normal Rust dependency management, versioning, and updates. | Cargo.toml and Cargo.lock |
| Copy | You want zero dependency surface and direct ownership of the source. | Your local source tree |
| CLI | You want guided search, add, copy, or optional managed tracking. | Depends on the command |
The rustuse CLI does not force a rustuse.toml workflow. You can use it for one-shot search, add, or copy commands without initializing project tracking.
• Install from crates.io with Cargo
Section titled “• Install from crates.io with Cargo”Use Cargo when you want RustUse to behave like a normal Rust dependency.
cargo add use-mathOr add the dependency manually:
[dependencies]use-math = "0.1"Cargo mode is usually best for:
- libraries
- shared codebases
- versioned updates
- normal Rust dependency workflows
- crates that contain more than one tiny utility
Focused crates and facade crates are both installed from crates.io.
cargo add use-combinatoricscargo add use-math• Copy source from rustuse.org
Section titled “• Copy source from rustuse.org”Use copy mode when you want to own the utility directly in your project.
Copy mode is usually best for:
- tiny helpers
- application code
- dependency-sensitive projects
- learning how a utility works
- adapting a utility to local project rules
- avoiding another dependency for a small amount of code
A copied utility should include provenance so the source, version, and license remain clear.
// Copied from RustUse: use-combinatorics v0.1.0// Source: https://rustuse.org/use-combinatorics/// License: MIT OR Apache-2.0• Use the RustUse CLI
Section titled “• Use the RustUse CLI”Use the rustuse CLI when you want faster discovery or guided adoption.
The CLI is intended to support workflows like:
rustuse search mathrustuse info use-mathrustuse add use-mathrustuse copy use-math --to src/math.rsrustuse copy use-math --with-testsCLI mode is useful when you want to:
- find the right utility
- add a crate dependency
- copy source into a project
- include tests or examples
- preserve source provenance
- optionally track copied utilities for future diffs and upgrades
The CLI supports both Cargo and copy workflows without requiring managed project tracking.
rustuse init is optional. Use it only when you want managed tracking for copied utilities, future diffs, or upgrade support. Cargo-only usage, copy-only usage, and one-shot CLI copy usage do not need rustuse.toml.
Choose your adoption path
Section titled “Choose your adoption path”Start with the narrowest path that fits the codebase.
| Question | Cargo | Copy | CLI without init | CLI with init |
|---|---|---|---|---|
| Do you want normal dependency updates? | Yes | No | Optional | Optional |
| Do you want zero dependency surface? | No | Yes | Yes, with copy | Yes, with copy |
| Do you want to modify the utility locally? | Not usually | Yes | Yes | Yes |
| Do you want RustUse project tracking? | No | No | No | Yes |
| Do you want future diff or upgrade support for copied source? | No | No | No | Yes |
| Do you want the easiest Rust default? | Yes | No | Sometimes | No |
When unsure, start with Cargo for libraries and copy mode for experimenting with utilities.
Use rustuse init only after you know you want RustUse-managed tracking.
Choose the boundary intentionally: Cargo keeps RustUse external, copy mode makes the source yours, and managed CLI mode adds optional tracking for copied utilities.
Choose the right use-*
Section titled “Choose the right use-*”Once you know how you want to adopt RustUse, select the child crate or facade that matches the use case.
- Use a focused child crate when the problem is narrow.
- Use a facade when a broader domain boundary makes the codebase clearer.
For example:
- Start with
use-mathwhen you want one facade dependency that exposes curated functionality through features and a sharedprelude. - Start with
use-combinatoricsfor counting, permutations, combinations, factorials, and other discrete helpers when the fulluse-mathfacade is broader than the problem requires.
Use only what fits
Section titled “Use only what fits”Start narrow. Choose a focused RustUse entry point that solves the problem, then compose outward only when a broader facade makes the codebase clearer.