Unified Rust 2024 Workspace for Core Macros, CLI Tooling, Async Concurrency, Networking, Security & Payments
Workspace Matrix · Architecture · Quick Start · Unified Formatter (crate fmt) · Verification · Agent Governance
ctares is the foundational monorepo under the crates-dev GitHub organization. It consolidates 35 independently published Rust crates into a single version-synchronized Cargo workspace while preserving each crate's isolated directory layout, unit/integration test suite, and independent crates.io release lifecycle.
It powers upstream developer tooling and shared runtime primitives across the euv, hyperlane, hyperlane-quick-start, and commerce-suite ecosystem.
flowchart TB
CLI["Toolchain & Unified Formatter\ncrate-cli (bump · sync · publish · fmt)"]
Macros["Macro Suite\nlombok-macros · instrument-level · clonelicious · future-fn · std-macro-extensions"]
Runtime["Async, Resilience, Logging & Time\ntokio-broadcast · recoverable-spawn · recoverable-thread-pool · atomic-circuit-breaker · token-bucket · jitter-backoff · utc-cron-expr · color-log · color-output · system-time"]
Data["Encoding, Config, Hashing, IDs, Auth & Payments\nbin-encode-decode · chunkify · compare_version · chinese-identification-card · atomic-snowflake · wildcard-glob · ketama-hash-ring · bloom-bitset · dotenv-typed · hmac-sha256-sign · jwt-service · stripe-pay-*"]
Net["Networking & Transport\ncidr-radix · tcplane · tcp-request · udp · udp-request"]
CLI --> Runtime
Macros --> CLI
Macros --> Runtime
Macros --> Data
Macros --> Net
Data --> Net
| Crate | crates.io | docs.rs | Responsibility |
|---|---|---|---|
crate-cli |
Cargo lifecycle CLI (bump, sync, publish, fmt) with VS Code Prettier 3.7.4 & Taplo 0.7.0 aligned unified text and Rust formatting |
| Crate | crates.io | docs.rs | Responsibility |
|---|---|---|---|
lombok-macros |
Derive macros for Getter, GetterMut, Setter, Data, New, CustomDebug, and DisplayDebug |
||
instrument-level |
Tracing instrumentation attribute macros by log level (trace, debug, info, warn, error) |
||
clonelicious |
Concise clone! macro for cloning captured state before closure invocation |
||
future-fn |
Ergonomic macros for async closures capturing owned values by move | ||
std-macro-extensions |
Standard library collection, smart pointer, sync primitive, and I/O helper macros |
| Crate | crates.io | docs.rs | Responsibility |
|---|---|---|---|
color-output |
Atomic ANSI colored console output functions and builder API | ||
color-log |
Sync and Tokio-async logger with custom handlers and size-based log file rotation | ||
tokio-broadcast |
High-throughput Broadcast and keyed BroadcastMap pub/sub channels over Tokio |
||
recoverable-spawn |
Panic-catching sync and async task spawners with recovery hooks | ||
recoverable-thread-pool |
Self-healing worker thread pool built atop recoverable-spawn |
||
atomic-circuit-breaker |
Zero-dependency lock-free atomic sliding-window circuit breaker with CAS probe gating | ||
token-bucket |
Zero-dependency lock-free atomic GCRA, Fixed-Window, Token-Bucket & 64-way sharded keyed rate limiter | ||
jitter-backoff |
Zero-dependency exponential backoff, full/equal/decorrelated jitter, atomic retry budgets & Retry-After parser |
||
utc-cron-expr |
Zero-dependency 5/6-field cron expression parser, O(1) bitmask matcher & civil-calendar next-run calculator |
| Crate | crates.io | docs.rs | Responsibility |
|---|---|---|---|
bin-encode-decode |
Binary encoding and decoding with customizable character sets beyond Base64 | ||
chunkify |
Deterministic byte/file chunk splitting and resumable reassembly | ||
compare_version |
Semantic version parsing, ordering, and compatibility verification | ||
system-time |
Locale-aware system clock formatting and timestamp helpers | ||
chinese-identification-card |
GB 11643 Chinese resident ID validation and checksum verification | ||
atomic-snowflake |
Zero-dependency lock-free monotonic Snowflake ID, ULID & RFC 9562 UUIDv7 generators with stack codecs | ||
wildcard-glob |
Zero-dependency zero-allocation compiled wildcard & path glob matcher with brace alternation & GlobSet |
||
ketama-hash-ring |
Zero-dependency Jump Consistent Hash, weighted Ketama virtual-node rings & Google Maglev O(1) tables | ||
bloom-bitset |
Zero-dependency cache-line-blocked Bloom filter, 4-bit Counting Bloom filter & HyperLogLog cardinality estimator | ||
dotenv-typed |
Zero-dependency .env parser, layered typed environment config loader & redacting SecretString |
||
hmac-sha256-sign |
Zero-dependency pure-Rust SHA-256, midstate HMAC-SHA256, HKDF-SHA256, Base64URL, signed tokens & HOTP/TOTP | ||
jwt-service |
Async JWT generation, verification, and typed custom claims | ||
stripe-pay-core |
Shared Stripe payment domain types, money precision, and form encoding | ||
stripe-pay-server |
Server-side Stripe transport and constant-time HMAC-SHA256 webhook verification | ||
stripe-pay-client |
Browser/WASM Stripe checkout element configuration over stripe-pay-core |
| Crate | crates.io | docs.rs | Responsibility |
|---|---|---|---|
cidr-radix |
Zero-dependency zero-allocation IPv4/IPv6 CIDR parser, matcher & /8-radix IpCidrSet |
||
tcplane |
Lightweight Tokio async TCP server with hooks and connection lifecycle | ||
tcp-request |
Raw synchronous TCP request client with redirect and response support | ||
udp |
Lightweight Tokio async UDP datagram server with request-response hooks | ||
udp-request |
Raw UDP datagram request/response client |
Install the workspace CLI globally or invoke any crate directly from crates.io:
cargo install crate-cli
crate fmt --checkOr add any individual library crate to your project:
cargo add lombok-macros color-output tokio-broadcastcrate-cli provides the ecosystem's single source of truth for multi-language text and Rust formatting, aligned with VS Code's esbenp.prettier-vscode (Prettier 3.7.4: tabWidth: 2, singleQuote: true, semi: true, printWidth: 80, proseWrap: "preserve", bracketSpacing: true, trailingComma: "all", arrowParens: "always", jsxSingleQuote: false, objectWrap: "preserve", vueIndentScriptAndStyle: false, endOfLine: "lf"), tamasfe.even-better-toml (Taplo 0.7.0 tabSize = 4), and rustfmt:
- Markdown (
.md,.markdown,.mdx): YAML frontmatter, CJK/emoji-width-aware GFM tables, lists, blockquotes, PrettiersingleQuote: truelink titles, empty fenced code blocks, and Prettier-supported embedded fences (js/ts/json/yaml/css/scss/less/html/vue/md, leavingtoml/sh/bash/rustverbatim). - YAML (
.yml,.yaml,.prettierrc): 2-space indentation, single-quoted scalars, 80-column flow wrapping/collapse, verbatim block scalars, GitHub Actions${{ ... }}preservation, and.prettierrcJSON/YAML auto-detection. - JSON / JSON-Stringify / JSONC (
.json,package.json,package-lock.json,composer.json,.jsonc,.cjson):objectWrap: "preserve"for.json(with comments allowed and trailing commas stripped fortsconfig.json/.vscode/settings.json), always-expandedjson-stringifyfor package manifests, and comment plus trailing-comma retention for.jsonc/.cjson. - TOML (
.toml): Taplo 0.7.0 defaults (tabSize = 4, 80-column array/inline-table auto-expand, short-array auto-collapse,allowed_blank_lines = 2,align_comments = true, verbatim fallback on invalid TOML). - Web Languages (
.js,.mjs,.cjs,.wxs,.ts,.mts,.cts,.tsx,.css,.wxss,.scss,.less,.html,.htm,.vue): Full Prettier 3.7.4 formatting including embedded HTML/Vue<script>and<style>blocks. - VS Code No-Op Preservation &
.prettierignore: Unformatted text/config/script files (LICENSE,.gitattributes,.gitignore,.dockerignore,.editorconfig,pre-commit,.sh/.bash/.zsh,Makefile,Dockerfile,.env,.txt,.conf,.ini,.xml,.svg,.py,.sql,.jsx,Cargo.lock) are preserved byte-for-byte; workspace-root.prettierignorerules and symlink-loop guards are honored during traversal. - Rust (
.rs): Deterministic#[derive(...)]sorting +cargo fmt. - Library Entry Points: Downstream CLIs (
euv fmt,hyperlane fmt) invokecrate_cli::execute_unified_fmt,crate_cli::format_workspace_text_files, andcrate_cli::format_text_by_pathas their first pass before framework-specific formatting.
Run the complete local verification suite matching .github/workflows/rust.yml:
cargo run -p crate-cli -- fmt
cargo run -p crate-cli -- fmt --check
cargo fmt --all -- --check
cargo clippy --workspace --all-features --all-targets -- -D warnings
cargo test --workspace --all-features
cargo check --release --workspace --all-features- Engineering architecture, crate boundaries, release cascade, and documentation maintenance triggers are defined in
AGENTS.md. - Project-specific agent workflow standards are maintained in
.agents/skills/ctares/SKILL.md.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please follow the rules in AGENTS.md and open a pull request.
For inquiries, please contact the author at root@devhub.vip.