Skip to content

Modules

The helpers4 crate is organised in 28 modules. Each module is a Cargo feature of the same name, and all of them are enabled by default (cargo add helpers4).

Turn the default features off and name the modules you want:

cargo add helpers4 --no-default-features --features string,hex

or in Cargo.toml:

[dependencies]
helpers4 = { version = "0.0.6", default-features = false, features = ["string", "hex"] }
ModuleCargo featureWhat it coversItems
ansiansiANSI escape sequences: remove them from captured output and build styled text.5
arrayarrayHelpers for slices and Vecs that the standard library does not provide.13
bytesbytesHelpers for byte slices and sizes that the standard library does not provide.10
cachecacheCaches and stores whose entries expire.2
ciciDetecting CI environments and reporting pipeline status.7
colorcolorColors without a dependency: parsing, hex, HSL, blending and WCAG contrast.6
commitcommitConventional Commits: parse a message, decide the version bump, validate.6
datedateCalendar dates without time zones: validation, ISO 8601 text, weekdays and day arithmetic.5
durationdurationParsing and formatting of durations as short human-readable strings (1h30m).3
envenvDotenv (.env) helpers working on plain text: no file or process-environment access, so they are deterministic and easy to test.5
fsfsFile-system helpers: safe writes, missing-file-as-None, listing and path checks.5
functionfunctionHelpers around functions: composition, memoization, retrying and rate limiting.6
futurefutureRuntime-neutral helpers for Futures, built on the standard library only.5
hexhexHexadecimal encoding and decoding with typed errors.6
httphttpHTTP header value helpers on plain text: no dependency on an HTTP crate.1
iteriterHelpers for any Iterator, not only slices: work on a lazy, single-use or unbounded source.3
licenselicenseSPDX license identifiers and expressions: look a license up, parse MIT OR Apache-2.0, check it against a policy, write a source header.7
mapmapHelpers for HashMap that the standard library does not provide.3
markdownmarkdownHelpers for writing Markdown safely: escaping, links, code, quotes, tables and heading anchors.7
netnetNetwork helpers on std::net and plain text: no I/O, no resolution.3
numbernumberNumeric helpers that the standard library does not provide.7
secretsecretKeeping secrets out of logs: a wrapper that never prints its value, redaction, masking and credential detection.8
setsetHelpers for HashSet that the standard library does not provide.7
stringstringString manipulation and formatting helpers.14
timetimeTime helpers.3
urlurlURLs without a dependency: percent-encoding, query strings, a parser and reference resolution.8
validatevalidateShape checks for common user-facing formats: pragmatic subsets that catch real mistakes, not full grammars.3
versionversionSemantic 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.6. Minimum supported Rust version: 1.85.