rskit-util
L0 domain-free utility primitives for the rskit ecosystem.
rskit-util owns low-level, domain-free primitives that are useful across foundation and higher-level crates. It has no internal workspace crate dependencies; small external dependencies are limited to capabilities that must live at L0, such as serde support and zeroizing secret storage.
What belongs here
Use rskit-util for reusable helpers that have no service, transport, config, storage, validation, or AI domain ownership. Domain-owned helpers stay in their owning crates:
- Secret masking primitive:
rskit_util::SecretString - Validation rules and
AppErrorconversion:rskit-validation - Schema generation and JSON Schema validation:
rskit-schema - Filesystem operations and safe paths:
rskit-fs - Generic clocks and UTC formatting:
rskit_util::time
Modules
| Module | Purpose |
|---|---|
backoff |
Stateless exponential backoff and deterministic jitter calculations |
bytes |
Human-readable byte size formatting and parsing |
collections |
chunk, group_by, index_by, and partition helpers |
env |
Environment variable lookup, non-empty filtering, parsing, and defaults |
secret |
Secret string masking for logs, debug output, and serialization |
strings |
Case conversion and UTF-8-safe truncation |
template |
Typed {placeholder} template parsing and rendering |
time |
Duration formatting/parsing, UTC civil date/time conversion, RFC 3339/compact UTC helpers, injectable clocks, and timing helpers |
Usage
[]
= "0.2.0-alpha.1"
Secret values
use SecretString;
let password = new;
assert_eq!;
assert_eq!;
assert_eq!;
Parsing sizes and durations
use Duration;
assert_eq!;
assert_eq!;
Environment lookup
assert_eq!;
let value = get_or;
assert_eq!;
UTC date/time helpers
use ;
assert_eq!;
assert_eq!;
assert_eq!;
let clock = new;
assert_eq!;
Typed templates
use fmt;
use ;
let template = parse?;
let rendered = template.render_with?;
assert_eq!;
# Ok::
Cross-kit alignment
This crate mirrors the utility modules in:
- gokit —
github.com/kbukum/gokit/util - pykit —
pykit-utilpackage