docs: 添加 Rustdoc 注释

This commit is contained in:
2026-08-05 21:46:47 +08:00
parent 7c8f19f61a
commit 263fd255b6
158 changed files with 1440 additions and 15 deletions
+2
View File
@@ -1,5 +1,6 @@
use serde::{Deserialize, Serialize};
/// 单次 benchmark 测试收集的完整指标集(可序列化为 JSON 用于基线持久化)。
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MetricCollection {
pub test_name: String,
@@ -21,6 +22,7 @@ pub struct MetricCollection {
}
impl MetricCollection {
/// 导出为 `(指标名, 值)` 列表,供回归对比与表格输出遍历。
pub fn iter_metrics(&self) -> Vec<(&'static str, f64)> {
vec![
("wall_time_us", self.wall_time_us as f64),