From 0e00aa9daebf0ee1a43c0105911c46f68528c16e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A1=A5=E4=B8=8B=E7=BA=A2=E8=8D=AF?= Date: Sun, 18 Jan 2026 23:08:41 +0800 Subject: [PATCH] update --- Cargo.toml | 2 +- README.md | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 728f2cc..b662445 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dht-crawler" -version = "0.0.5" +version = "0.0.6" edition = "2024" authors = ["桥下红药 <1121744186@qq.com>"] description = "高性能的 Rust DHT (Distributed Hash Table) 爬虫库 | A high-performance Rust DHT crawler library for fetching torrent information from the BitTorrent DHT network" diff --git a/README.md b/README.md index 750b8f3..344a78c 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ ```toml [dependencies] -dht-crawler = "0.0.5" +dht-crawler = "0.0.6" ``` 或者查看 [crates.io](https://crates.io/crates/dht-crawler) 获取最新版本号。 @@ -32,7 +32,7 @@ dht-crawler = "0.0.5" ```toml [dependencies] -dht-crawler = { version = "0.0.5", features = ["metrics"] } +dht-crawler = { version = "0.0.6", features = ["metrics"] } ``` ## Features @@ -110,6 +110,12 @@ cargo build --release --target x86_64-unknown-linux-gnu --examples --features mi # target/x86_64-unknown-linux-gnu/release/examples/dht_crawler_example ``` +> **⚠️ 重要说明:交叉编译特性支持** +> +> - 使用 `cargo build --lib` 编译库时,**仅支持 `metrics` 可选特性** +> - `mimalloc` feature 仅在编译 examples 时可用(位于 `dev-dependencies`) +> - 如果需要同时使用 `mimalloc` 和 `metrics`,请使用 `cargo build --examples` 编译示例 + ### 运行示例 #### 基本运行(不使用任何 features) @@ -149,19 +155,23 @@ cargo run --example dht_crawler_example --features mimalloc,metrics ```toml [dependencies] -dht-crawler = "0.0.4" +dht-crawler = "0.0.6" ``` #### 使用库并启用 metrics feature ```toml [dependencies] -dht-crawler = { version = "0.0.4", features = ["metrics"] } +dht-crawler = { version = "0.0.6", features = ["metrics"] } ``` 这样可以在你的代码中使用库暴露的 metrics 指标。 -**注意**:`mimalloc` feature 仅用于 example,库本身不依赖 mimalloc。 +> **⚠️ 重要说明:特性支持限制** +> +> - **`--lib` 编译库时**:**仅支持 `metrics` 可选特性** +> - **`mimalloc` feature**:仅用于编译 examples(位于 `dev-dependencies`),库本身不依赖 mimalloc +> - 如果需要同时使用 `mimalloc` 和 `metrics`,请使用 `--examples` 编译示例程序 ## 许可证