Features
- Zero-Dependency JSON Extraction: Custom parsing logic without
serde_json. - Custom block_on Runner: Built-in "Spin-then-Yield" strategy—no
tokioorasync-stdrequired. - Minimal Footprint: Only one external dependency (
native-tls) for secure HTTPS. - Deep Path Support: Robust dot-notation extraction (e.g.,
metadata.stats.0.count). - Human-Readable Formatting: Compacts large numbers (e.g.,
56000->56k)
About
crator is a high-performance utility designed for CLI tools where binary size and execution speed are critical. While most libraries rely on heavy async frameworks and full JSON serializers, crator achieves its minimal footprint by utilizing raw TCP/TLS streams and manual string-slice processing via a custom block_on runner.
By bypassing the overhead of traditional frameworks, it offers a direct, ultra-fast path to retrieve crate metadata from crates.io, process the response with a zero-copy extractor, and present the data in a clean, user-friendly format.
Installation
To include crator in your Rust project, run:
cargo add crator
Or add crator to your Cargo.toml. Since crator re-exports its TLS connector, no other dependencies are required.
[]
= "MAJOR.MINOR.PATCH"
Key Components
CrateInfo: Struct holding metadata like versions, download counts, and license info.crate_data: Async function that performs secure HTTPS requests to the crates.io API.Json: A zero-dependency utility for ultra-fast value extraction.block_on: A custom, lightweight "Spin-then-Yield" runner for driving futures to completion.format_number: Function to convert large numbers into compact strings (e.g.,56k).TlsConnector: Re-exported fromnative-tlsfor zero-config secure connections.Instant: Re-exported fromstd::timefor easy high-precision benchmarking.
Examples
use ;
use *;
use *;
License
This project is licensed under the MIT License or Apache 2.0 License.nnector, no other dependencies are required.