Thanks to visit codestin.com
Credit goes to rustuse.org

Skip to content

Onboarding

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.

Ferris sailing through the RustUse onboarding guide Ferris sailing through the RustUse onboarding guide

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.

RustUse supports three adoption paths. No path is the only correct one. They represent different ownership and update boundaries.

PathBest whenBoundary
CargoYou want normal Rust dependency management, versioning, and updates.Cargo.toml and Cargo.lock
CopyYou want zero dependency surface and direct ownership of the source.Your local source tree
CLIYou 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.

Use Cargo when you want RustUse to behave like a normal Rust dependency.

Terminal window
cargo add use-math

Or 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.

Terminal window
cargo add use-combinatorics
cargo add use-math

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 when you want faster discovery or guided adoption.

The CLI is intended to support workflows like:

Terminal window
rustuse search math
rustuse info use-math
rustuse add use-math
rustuse copy use-math --to src/math.rs
rustuse copy use-math --with-tests

CLI 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.

Start with the narrowest path that fits the codebase.

QuestionCargoCopyCLI without initCLI with init
Do you want normal dependency updates?YesNoOptionalOptional
Do you want zero dependency surface?NoYesYes, with copyYes, with copy
Do you want to modify the utility locally?Not usuallyYesYesYes
Do you want RustUse project tracking?NoNoNoYes
Do you want future diff or upgrade support for copied source?NoNoNoYes
Do you want the easiest Rust default?YesNoSometimesNo

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.

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-math when you want one facade dependency that exposes curated functionality through features and a shared prelude.
  • Start with use-combinatorics for counting, permutations, combinations, factorials, and other discrete helpers when the full use-math facade is broader than the problem requires.

Start narrow. Choose a focused RustUse entry point that solves the problem, then compose outward only when a broader facade makes the codebase clearer.