-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
89 lines (72 loc) · 2.32 KB
/
Copy pathCargo.toml
File metadata and controls
89 lines (72 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
[package]
name = "execute"
version = "0.1.0"
edition = "2024"
rust-version = "1.85"
# docs.rs 文档生成配置
[package.metadata.docs.rs]
# 生成文档时启用所有 features,确保所有 API 都可见
all-features = true
# 显示 feature 标志
rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
thiserror = "2.0.17"
crossbeam-queue = "0.3"
wait-timeout = "0.2"
# 系统调用
nix = { version = "0.29", features = ["process", "signal"] }
# 并发
crossbeam = "0.8"
# 可选依赖:日志和追踪
tracing = { version = "0.1", optional = true }
tracing-subscriber = { version = "0.3", features = ["json", "env-filter", "fmt"], optional = true }
# 可选依赖:指标
hdrhistogram = { version = "7.5", optional = true }
# io_uring 支持(Linux 5.1+)
io-uring = { version = "0.6", optional = true }
slab = { version = "0.4", optional = true }
[features]
default = ["logging", "metrics", "health", "pipeline"]
# 核心功能(无需启用 feature,始终可用)
# - CommandPool, CommandConfig, CommandExecutor
# - 任务管理、超时控制、重试策略
# - 进程池、信号量、任务句柄
# 日志追踪功能(依赖 tracing)
logging = ["tracing", "tracing-subscriber"]
# 指标收集功能(依赖 hdrhistogram)
metrics = ["hdrhistogram"]
# 健康检查功能(纯 Rust 实现,无外部依赖)
health = []
# 管道功能(纯 Rust 实现,无外部依赖)
pipeline = []
# 最小功能集(仅核心功能)
minimal = []
# 全功能
full = ["logging", "metrics", "health", "pipeline"]
# io_uring 异步 I/O 优化(Linux 5.1+)
iouring = ["io-uring", "slab"]
[dev-dependencies]
criterion = "0.5"
proptest = "1.0"
tokio = { version = "1.40", features = ["process", "time", "rt-multi-thread"] }
num_cpus = "1.16"
# 发布版本体积优化配置
[profile.release]
# 优化级别:z 表示优化体积(比 s 更激进)
opt-level = "z"
# 启用链接时优化,减少重复代码
lto = true
# 代码生成单元数,设为1允许更多跨模块优化
codegen-units = 1
# 去除 panic 时的栈展开信息,减小体积
panic = "abort"
# 去除调试符号(如需要调试可设为 true 或仅用 strip)
strip = true
# 发布构建的替代配置(如果需要更好的运行时性能)
[profile.release-size]
inherits = "release"
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
strip = true