frewsxcv/rust-crates-index

GitHub: frewsxcv/rust-crates-index

一个用于通过 git 或 sparse 协议访问 crates.io 注册表索引的 Rust 库,可获取所有已发布 crate 的版本、依赖和特性标志等元数据。

Stars: 74 | Forks: 46

# crates-index [![crates-index on Crates.io](https://img.shields.io/crates/v/crates-index.svg)]() 用于通过 `git` 或 `sparse` 协议检索和交互 [crates.io registry index](https://doc.rust-lang.org/cargo/reference/registry-index.html) 的库。 该索引包含发布在 crates.io 上的所有 Rust 库和程序的元数据:它们的版本、依赖项和 feature flags。 [文档](https://docs.rs/crates-index/) ## 示例 ``` let index = crates_index::GitIndex::new_cargo_default()?; for crate_releases in index.crates() { let _ = crate_releases.most_recent_version(); // newest version let crate_version = crate_releases.highest_version(); // max version by semver println!("crate name: {}", crate_version.name()); println!("crate version: {}", crate_version.version()); } ``` ## 更新日志 请在 [CHANGELOG.md](https://github.com/frewsxcv/rust-crates-index/blob/master/CHANGELOG.md) 中查看更新日志。 ## 相似 crates - [`tame-index`](https://github.com/EmbarkStudios/tame-index) - 一个拥有许多改进和优势的硬分叉版本 - [`crates_io_api`](https://github.com/theduke/crates_io_api) - 一种与 crates.io 的 HTTP API 通信的方式 ## 许可证 根据 Apache 许可证第 2 版授权
标签:API客户端, Cargo, Crates.io, Git协议, Rust, Rust生态, Sparse协议, 云安全监控, 供应链, 依赖管理, 元数据, 包管理, 包索引, 可视化界面, 库, 应急响应, 开源, 注册表索引, 网络安全研究, 网络流量审计, 语义版本控制, 通知系统, 通知系统, 静态分析