Getting Started
Installation
Section titled “Installation”That enables every module. Each module is a Cargo feature of the same name, so to take only some of them, turn the default features off and name the ones you want:
Every module page shows the command for its feature and the matching Cargo.toml line with the current version. The crate is pre-1.0: pin the exact version and read the changelog before upgrading.
Quick Start
Section titled “Quick Start”Import through the module path:
Helpers take borrowed data (&str, slices) and return new values: nothing is mutated unless the documentation says so.
Errors
Section titled “Errors”A helper that can fail returns a Result with an error enum you can match on, never a bare bool that hides the reason:
Error enums are #[non_exhaustive]: new variants can be added without breaking your match, so keep a wildcard arm.
Names and imports
Section titled “Names and imports”Names repeat across modules on purpose, so always import through the module path rather than glob-importing a module (use helpers4::string::*; would make the next name collision your problem). When two helpers from different modules share a name, rename at the import site with as, suffixing the module name so the origin stays visible:
See Names and imports for the list of names that exist in more than one module.
Explicit inputs
Section titled “Explicit inputs”Nothing reads the time or the process environment behind your back:
cache::ExpiringMaptakesnowas an argument, so it is trivially testable and works with unix seconds, milliseconds or anInstant.envworks on the text of a.envfile, not on the process: you read the file, edit the content, and write it back.time::unix_nowis fallible: a clock set before 1970 is an error, not a silent0(which would make every expiry look valid).
Platforms
Section titled “Platforms”| Target | Support | Notes |
|---|---|---|
| Linux, macOS, Windows | ✅ | Tested in CI on stable, beta and the minimum supported Rust version |
wasm32-unknown-unknown, wasm32-wasip1 | ✅ builds | Checked to compile; not run there. time::unix_now needs a clock, which wasm32-unknown-unknown does not have |
no_std | ❌ | The crate uses std |
The minimum supported Rust version is shown on the modules overview.
Quality Standards
Section titled “Quality Standards”Every helper ships with:
- 100% code coverage (lines, functions and regions), enforced in CI
- Unit tests next to the implementation, and property-based tests (proptest): invariants checked against thousands of random inputs
- Doc tests — every example on the module pages is a test that runs on each change
- Mutation testing (cargo-mutants) — tests are checked to catch regressions, not just to execute the code
- Benchmarks (criterion) where speed matters, compared with the base branch on every pull request
- Lints —
clippyin pedantic mode withunwrap,expectandpanicdenied outside tests, andunsafeforbidden - Dependency and license audit (
cargo-deny) on every pull request and release - Traceable releases — published from CI with short-lived credentials (crates.io trusted publishing), with a build provenance attestation attached to each GitHub release
Next Steps
Section titled “Next Steps”- Browse the Modules
- Read the Philosophy
- View the GitHub repository
Contributing
Section titled “Contributing”Found a bug? Want to add a helper? Read Contributing.
License
Section titled “License”LGPL-3.0-or-later — see License for a summary and LICENSE for the full text.
