std-replacement-data
收藏资源简介:
一个精心整理的Rust crate数据集,这些crate的功能现在已在标准库中提供。crates.io读取它以指出当`std`已经覆盖了crate提供的功能时,以及在哪里找到等效的API。每个条目都是关于`std`的可检查事实陈述,而不是对竞争crate的意见。
A curated dataset of Rust crates whose functionality is now available in the Rust standard library. Crates.io utilizes this dataset to identify instances where the `std` library already covers the functionality provided by a given crate, as well as the locations of equivalent APIs within the standard library. Each entry comprises verifiable factual statements about the `std` library, rather than subjective opinions on competing crates.
数据集概述
数据集名称
std-replacement-data
数据集目的
该数据集是一个经过筛选的 Rust 包(crate)集合,这些包的功能现已包含在 Rust 标准库中。crates.io 使用该数据集来提示用户:标准库已经提供了某个包所实现的功能,并指引用户找到对应的 API。
数据内容与格式
- 每个包对应一个独立的 TOML 文件,存放在
data/<crate>.toml中。 - 每个文件包含两个字段:
description:Markdown 格式的解释,说明替换方式。必须引用稳定的标准库 API 以及稳定该 API 的 Rust 版本。url:指向文档或发布说明的链接,作为“了解更多”链接展示。
- 所有 TOML 文件通过
build.py打包为一个 JSON 文件build/all.json,以包名为键。
数据消费方式
- 构建后的 JSON 文件发布在 GitHub Pages:
https://rust-lang.github.io/std-replacement-data/all.json - 本地构建需要 Python 3.11 及以上版本(依赖
tomllib),命令为:python3 build.py
数据维护与贡献
- 由
crates.io团队维护,欢迎贡献新条目。 - 贡献标准与添加方式详见
CONTRIBUTING.md文件。 - 数据集旨在成为稳定数据源,但在稳定之前,内容和格式可能随时变化。
数据来源
数据最初内嵌于 crates.io,后迁出以便其他工具也能使用。原始实现见 rust-lang/crates.io#13855。
许可协议
- Apache License, Version 2.0
- MIT license





