# 定义可复用 DHT 爬虫基础库的包元数据依赖和功能开关 [package] name = "dht-crawler" version = "0.2.1" edition.workspace = true authors.workspace = true description = "高性能的 Rust DHT 爬虫基础库" license.workspace = true documentation = "https://docs.rs/dht-crawler" repository.workspace = true keywords = ["dht", "bittorrent", "crawler", "p2p", "torrent"] categories = ["network-programming", "asynchronous"] readme = "README.md" [lib] name = "dht_crawler" crate-type = ["rlib"] [dependencies] ahash = "0.8" arc-swap = "1.7" async-channel = "2.5.0" bytes = "1.0" crossbeam-queue = "0.3" hex = "0.4" log = "0.4" metrics = { version = "0.24", optional = true } rand = "0.10.2" rbit = "0.2" serde.workspace = true serde_bencode = "0.2" serde_bytes = "0.11.19" sha1 = "0.11.0" socket2 = { version = "0.6.5", features = ["all"] } thiserror.workspace = true tokio = { workspace = true, features = ["rt", "rt-multi-thread", "net", "sync", "time", "macros"] } tokio-util.workspace = true [dev-dependencies] metrics-exporter-prometheus = { version = "0.18", default-features = false, features = ["http-listener"] } mimalloc = "0.1" tokio = { workspace = true, features = ["signal"] } tracing.workspace = true tracing-subscriber = { workspace = true, features = ["env-filter", "fmt", "tracing-log"] } [features] default = [] metrics = ["dep:metrics"] mimalloc = [] [[example]] name = "dht_crawler_example" path = "examples/main.rs"