Modules
The helpers4 crate is organised in 34 modules. Each module is a Cargo feature of the same name, and all of them are enabled by default (cargo add helpers4).
A helper that needs a dependency the rest of its module does without sits behind an opt-in sub-feature named <module>-<what> (listed after its module below), so the default features stay dependency-free.
Install only what you use
Section titled “Install only what you use”Turn the default features off and name the modules you want:
or in Cargo.toml:
Modules
Section titled “Modules”| Module | Cargo feature | What it covers | Items |
|---|---|---|---|
animation | animation | Animation timing without a framework: Easing curves (the CSS keywords, cubic-bezier(), steps() and linear(), read from a CSS string or built directly), physical Springs with their settling time, and to_css_linear to turn any curve into a CSS linear(). | 5 |
ansi | ansi | ANSI escape sequences: remove them from captured output and build styled text. | 5 |
array | array | Helpers for slices and Vecs that the standard library does not provide. | 16 |
bytes | bytes | Helpers for byte slices and sizes that the standard library does not provide. | 15 |
cache | cache | Caches and stores: entries that expire with a passed-in clock (ExpiringMap), and a capacity-bounded map that evicts by recency instead (LruCache). | 3 |
ci | ci | Detecting CI environments and reporting pipeline status. | 7 |
color | color | Colors without a dependency: parsing, hex, CSS output, HSL, alpha, blending and WCAG contrast. | 12 |
commit | commit | Conventional Commits: parse a message, decide the version bump, validate. | 6 |
date | date | Calendar dates without time zones: validation, ISO 8601 text, weekdays and day arithmetic. | 5 |
duration | duration | Parsing and formatting of durations as short human-readable strings (1h30m). | 3 |
env | env | Dotenv (.env) helpers working on plain text: no file or process-environment access, so they are deterministic and easy to test. | 9 |
font | font | Fonts without a dependency: CSS font matching, the names design tools give to weights and styles, and reading a font file’s names, weight and style. | 14 |
fs | fs | File-system helpers: safe writes, missing-file-as-None, listing and path checks. | 5 |
function | function | Helpers around functions: composition, memoization, retrying and rate limiting. | 6 |
future | future | Runtime-neutral helpers for Futures, built on the standard library only. | 5 |
geometry | geometry | 2D geometry in f64: Point, Rect and the affine Matrix, in the layout of CSS and SVG matrix(a b c d e f). | 15 |
hex | hex | Byte/text encodings with typed errors: hexadecimal, and base64/base32 (RFC 4648). | 12 |
http | http | HTTP header value helpers on plain text: no dependency on an HTTP crate. | 1 |
id | id | Unique identifiers without the uuid or ulid crates: Uuid (v4 random, v7 sortable by time), Ulid, and short URL-safe ids over an Alphabet. | 8 |
iter | iter | Helpers for any Iterator, not only slices: work on a lazy, single-use or unbounded source. | 3 |
kiwi | kiwi | Decoding of the Kiwi binary format, Evan Wallace’s schema-based serialization (used by Figma’s .fig files, but generic). | 7 |
license | license | SPDX license identifiers and expressions: look a license up, parse MIT OR Apache-2.0, check it against a policy, write a source header. | 7 |
map | map | Helpers for HashMap that the standard library does not provide. | 3 |
markdown | markdown | Helpers for writing Markdown safely: escaping, links, code, quotes, tables and heading anchors. | 7 |
net | net | Network helpers on std::net and plain text: no I/O, no resolution. | 3 |
number | number | Numeric helpers that the standard library does not provide. | 7 |
random | random, random-entropy | Randomness without a hidden global generator. | 8 |
secret | secret | Keeping secrets out of logs: a wrapper that never prints its value, redaction, masking and credential detection. | 8 |
set | set | Helpers for HashSet that the standard library does not provide. | 7 |
string | string, string-diacritics | String manipulation and formatting helpers. | 26 |
time | time | Time helpers. | 3 |
url | url | URLs without a dependency: percent-encoding, query strings, a parser and reference resolution. | 8 |
validate | validate | Shape checks for common user-facing formats: pragmatic subsets that catch real mistakes, not full grammars. | 3 |
version | version | Semantic Versioning 2.0.0: parsing, precedence, bumps and Cargo-style requirements. | 5 |
Import through the module path (helpers4::string::capitalize): names can repeat across modules on purpose, so never glob-import a module.
Documented version: 0.0.11. Minimum supported Rust version: 1.85.
