Skip to main content

CheckResult

Struct CheckResult 

Source
pub struct CheckResult {
    pub name: String,
    pub verdict: Verdict,
    pub severity: Option<Severity>,
    pub detail: Option<String>,
    pub at: DateTime<Utc>,
    pub duration_ms: Option<u64>,
    pub tags: Vec<String>,
    pub evidence: Vec<Evidence>,
}
Expand description

Result of a single check.

§Example

use dev_report::{CheckResult, Severity, Verdict};

let c = CheckResult::fail("unit::math", Severity::Error)
    .with_detail("expected 42, got 41")
    .with_duration_ms(7);
assert_eq!(c.verdict, Verdict::Fail);

Fields§

§name: String

Stable identifier for the check (e.g. compile, test::round_trip).

§verdict: Verdict

Outcome of the check.

§severity: Option<Severity>

Severity when the verdict is Fail or Warn. None for Pass and Skip.

§detail: Option<String>

Human-readable detail. Optional.

§at: DateTime<Utc>

Time the check ran. UTC.

§duration_ms: Option<u64>

Duration of the check, in milliseconds. Optional.

§tags: Vec<String>

Free-form tags for filtering (e.g. "slow", "flaky", "bench").

Defaults to empty. v0.1.0 reports deserialize cleanly with no tags.

§evidence: Vec<Evidence>

Structured evidence backing this check.

Defaults to empty. v0.1.0 reports deserialize cleanly with no evidence.

Implementations§

Source§

impl CheckResult

Source

pub fn pass(name: impl Into<String>) -> Self

Build a passing check result with the given name.

§Example
use dev_report::{CheckResult, Verdict};

let c = CheckResult::pass("compile");
assert_eq!(c.verdict, Verdict::Pass);
assert!(c.severity.is_none());
Examples found in repository?
examples/sarif_export.rs (line 18)
15fn main() {
16    let mut r = Report::new("sample-subject", "0.9.3").with_producer("dev-bench");
17
18    r.push(CheckResult::pass("compile"));
19    r.push(CheckResult::skip("network"));
20
21    r.push(
22        CheckResult::fail("test::round_trip", Severity::Error)
23            .with_detail("expected 42, got 41")
24            .with_evidence(Evidence::file_ref_lines("site", "src/math.rs", 10, 12)),
25    );
26
27    r.push(
28        CheckResult::fail("integration::startup", Severity::Critical)
29            .with_detail("service refused to start")
30            .with_evidence(Evidence::file_ref("source", "src/bin/server.rs")),
31    );
32
33    r.push(
34        CheckResult::warn("style::trailing_ws", Severity::Warning)
35            .with_detail("3 trailing-whitespace warnings"),
36    );
37
38    r.finish();
39
40    println!("{}", r.to_sarif());
41}
More examples
Hide additional examples
examples/junit_export.rs (line 19)
16fn main() {
17    let mut r = Report::new("sample-subject", "0.9.3").with_producer("dev-bench");
18
19    r.push(CheckResult::pass("compile").with_duration_ms(120));
20    r.push(CheckResult::pass("test::math").with_duration_ms(7));
21
22    r.push(
23        CheckResult::fail("test::round_trip", Severity::Error)
24            .with_duration_ms(13)
25            .with_detail("expected 42, got 41"),
26    );
27
28    r.push(
29        CheckResult::fail("integration::startup", Severity::Critical)
30            .with_detail("service refused to start"),
31    );
32
33    r.push(
34        CheckResult::warn("style::trailing_ws", Severity::Warning)
35            .with_detail("3 trailing-whitespace warnings"),
36    );
37
38    r.push(CheckResult::skip("integration::network").with_detail("no network in sandbox"));
39
40    r.finish();
41
42    println!("{}", r.to_junit_xml());
43}
examples/schema_sample.rs (line 29)
21fn build_report(producer: &str) -> Report {
22    let frozen_start = chrono::Utc.with_ymd_and_hms(2026, 5, 11, 12, 0, 0).unwrap();
23    let frozen_end = chrono::Utc.with_ymd_and_hms(2026, 5, 11, 12, 0, 5).unwrap();
24
25    let mut r = Report::new("sample-subject", "0.9.3").with_producer(producer);
26    r.set_started_at(frozen_start);
27
28    // Pass with no detail, no severity, no tags, no evidence.
29    let mut c1 = CheckResult::pass("compile");
30    c1.at = frozen_start;
31    r.push(c1);
32
33    // Pass with a duration and a single numeric evidence.
34    let mut c2 = CheckResult::pass("bench::parse")
35        .with_duration_ms(7)
36        .with_tag("bench")
37        .with_evidence(Evidence::numeric("mean_ns", 1234.5))
38        .with_evidence(Evidence::numeric_int("iterations", 1_000_000));
39    c2.at = frozen_start;
40    r.push(c2);
41
42    // Warn with key-value evidence.
43    let mut c3 = CheckResult::warn("env::leaked", Severity::Warning)
44        .with_detail("RUST_LOG was set during test")
45        .with_evidence(Evidence::kv("env", [("CI", "true"), ("RUST_LOG", "debug")]));
46    c3.at = frozen_start;
47    r.push(c3);
48
49    // Fail with snippet + file_ref (no line range) + file_ref (with line range).
50    let mut c4 = CheckResult::fail("test::round_trip", Severity::Error)
51        .with_detail("expected 42, got 41")
52        .with_duration_ms(13)
53        .with_tags(["unit", "flaky"])
54        .with_evidence(Evidence::snippet(
55            "panic",
56            "assertion `left == right` failed",
57        ))
58        .with_evidence(Evidence::file_ref("source", "src/math.rs"))
59        .with_evidence(Evidence::file_ref_lines(
60            "call_site",
61            "tests/smoke.rs",
62            42,
63            47,
64        ));
65    c4.at = frozen_start;
66    r.push(c4);
67
68    // Fail with Critical severity.
69    let mut c5 = CheckResult::fail("integration::startup", Severity::Critical)
70        .with_detail("service refused to start");
71    c5.at = frozen_start;
72    r.push(c5);
73
74    // Warn with Info severity (lowest severity, still warn verdict).
75    let mut c6 = CheckResult::warn("style::trailing_ws", Severity::Info)
76        .with_detail("3 trailing-whitespace warnings");
77    c6.at = frozen_start;
78    r.push(c6);
79
80    // Skip with no severity.
81    let mut c7 = CheckResult::skip("integration::network").with_detail("no network in sandbox");
82    c7.at = frozen_start;
83    r.push(c7);
84
85    // Manually-constructed FileRef via Evidence::file_ref (covered above);
86    // also exercise a standalone FileRef with line_start but no line_end —
87    // valid per the schema (both are optional independently).
88    let mut c8 = CheckResult::pass("doc::link_check");
89    c8.at = frozen_start;
90    let standalone = FileRef::new("docs/index.md").with_line_range(10, 10);
91    c8 = c8.with_evidence(Evidence {
92        label: "anchor".into(),
93        data: dev_report::EvidenceData::FileRef(standalone),
94    });
95    r.push(c8);
96
97    r.set_finished_at(Some(frozen_end));
98    r
99}
Source

pub fn fail(name: impl Into<String>, severity: Severity) -> Self

Build a failing check result with the given name and severity.

§Example
use dev_report::{CheckResult, Severity, Verdict};

let c = CheckResult::fail("test::round_trip", Severity::Error);
assert_eq!(c.verdict, Verdict::Fail);
assert_eq!(c.severity, Some(Severity::Error));
Examples found in repository?
examples/sarif_export.rs (line 22)
15fn main() {
16    let mut r = Report::new("sample-subject", "0.9.3").with_producer("dev-bench");
17
18    r.push(CheckResult::pass("compile"));
19    r.push(CheckResult::skip("network"));
20
21    r.push(
22        CheckResult::fail("test::round_trip", Severity::Error)
23            .with_detail("expected 42, got 41")
24            .with_evidence(Evidence::file_ref_lines("site", "src/math.rs", 10, 12)),
25    );
26
27    r.push(
28        CheckResult::fail("integration::startup", Severity::Critical)
29            .with_detail("service refused to start")
30            .with_evidence(Evidence::file_ref("source", "src/bin/server.rs")),
31    );
32
33    r.push(
34        CheckResult::warn("style::trailing_ws", Severity::Warning)
35            .with_detail("3 trailing-whitespace warnings"),
36    );
37
38    r.finish();
39
40    println!("{}", r.to_sarif());
41}
More examples
Hide additional examples
examples/junit_export.rs (line 23)
16fn main() {
17    let mut r = Report::new("sample-subject", "0.9.3").with_producer("dev-bench");
18
19    r.push(CheckResult::pass("compile").with_duration_ms(120));
20    r.push(CheckResult::pass("test::math").with_duration_ms(7));
21
22    r.push(
23        CheckResult::fail("test::round_trip", Severity::Error)
24            .with_duration_ms(13)
25            .with_detail("expected 42, got 41"),
26    );
27
28    r.push(
29        CheckResult::fail("integration::startup", Severity::Critical)
30            .with_detail("service refused to start"),
31    );
32
33    r.push(
34        CheckResult::warn("style::trailing_ws", Severity::Warning)
35            .with_detail("3 trailing-whitespace warnings"),
36    );
37
38    r.push(CheckResult::skip("integration::network").with_detail("no network in sandbox"));
39
40    r.finish();
41
42    println!("{}", r.to_junit_xml());
43}
examples/schema_sample.rs (line 50)
21fn build_report(producer: &str) -> Report {
22    let frozen_start = chrono::Utc.with_ymd_and_hms(2026, 5, 11, 12, 0, 0).unwrap();
23    let frozen_end = chrono::Utc.with_ymd_and_hms(2026, 5, 11, 12, 0, 5).unwrap();
24
25    let mut r = Report::new("sample-subject", "0.9.3").with_producer(producer);
26    r.set_started_at(frozen_start);
27
28    // Pass with no detail, no severity, no tags, no evidence.
29    let mut c1 = CheckResult::pass("compile");
30    c1.at = frozen_start;
31    r.push(c1);
32
33    // Pass with a duration and a single numeric evidence.
34    let mut c2 = CheckResult::pass("bench::parse")
35        .with_duration_ms(7)
36        .with_tag("bench")
37        .with_evidence(Evidence::numeric("mean_ns", 1234.5))
38        .with_evidence(Evidence::numeric_int("iterations", 1_000_000));
39    c2.at = frozen_start;
40    r.push(c2);
41
42    // Warn with key-value evidence.
43    let mut c3 = CheckResult::warn("env::leaked", Severity::Warning)
44        .with_detail("RUST_LOG was set during test")
45        .with_evidence(Evidence::kv("env", [("CI", "true"), ("RUST_LOG", "debug")]));
46    c3.at = frozen_start;
47    r.push(c3);
48
49    // Fail with snippet + file_ref (no line range) + file_ref (with line range).
50    let mut c4 = CheckResult::fail("test::round_trip", Severity::Error)
51        .with_detail("expected 42, got 41")
52        .with_duration_ms(13)
53        .with_tags(["unit", "flaky"])
54        .with_evidence(Evidence::snippet(
55            "panic",
56            "assertion `left == right` failed",
57        ))
58        .with_evidence(Evidence::file_ref("source", "src/math.rs"))
59        .with_evidence(Evidence::file_ref_lines(
60            "call_site",
61            "tests/smoke.rs",
62            42,
63            47,
64        ));
65    c4.at = frozen_start;
66    r.push(c4);
67
68    // Fail with Critical severity.
69    let mut c5 = CheckResult::fail("integration::startup", Severity::Critical)
70        .with_detail("service refused to start");
71    c5.at = frozen_start;
72    r.push(c5);
73
74    // Warn with Info severity (lowest severity, still warn verdict).
75    let mut c6 = CheckResult::warn("style::trailing_ws", Severity::Info)
76        .with_detail("3 trailing-whitespace warnings");
77    c6.at = frozen_start;
78    r.push(c6);
79
80    // Skip with no severity.
81    let mut c7 = CheckResult::skip("integration::network").with_detail("no network in sandbox");
82    c7.at = frozen_start;
83    r.push(c7);
84
85    // Manually-constructed FileRef via Evidence::file_ref (covered above);
86    // also exercise a standalone FileRef with line_start but no line_end —
87    // valid per the schema (both are optional independently).
88    let mut c8 = CheckResult::pass("doc::link_check");
89    c8.at = frozen_start;
90    let standalone = FileRef::new("docs/index.md").with_line_range(10, 10);
91    c8 = c8.with_evidence(Evidence {
92        label: "anchor".into(),
93        data: dev_report::EvidenceData::FileRef(standalone),
94    });
95    r.push(c8);
96
97    r.set_finished_at(Some(frozen_end));
98    r
99}
Source

pub fn warn(name: impl Into<String>, severity: Severity) -> Self

Build a warning check result with the given name and severity.

§Example
use dev_report::{CheckResult, Severity, Verdict};

let c = CheckResult::warn("flaky", Severity::Warning);
assert_eq!(c.verdict, Verdict::Warn);
Examples found in repository?
examples/sarif_export.rs (line 34)
15fn main() {
16    let mut r = Report::new("sample-subject", "0.9.3").with_producer("dev-bench");
17
18    r.push(CheckResult::pass("compile"));
19    r.push(CheckResult::skip("network"));
20
21    r.push(
22        CheckResult::fail("test::round_trip", Severity::Error)
23            .with_detail("expected 42, got 41")
24            .with_evidence(Evidence::file_ref_lines("site", "src/math.rs", 10, 12)),
25    );
26
27    r.push(
28        CheckResult::fail("integration::startup", Severity::Critical)
29            .with_detail("service refused to start")
30            .with_evidence(Evidence::file_ref("source", "src/bin/server.rs")),
31    );
32
33    r.push(
34        CheckResult::warn("style::trailing_ws", Severity::Warning)
35            .with_detail("3 trailing-whitespace warnings"),
36    );
37
38    r.finish();
39
40    println!("{}", r.to_sarif());
41}
More examples
Hide additional examples
examples/junit_export.rs (line 34)
16fn main() {
17    let mut r = Report::new("sample-subject", "0.9.3").with_producer("dev-bench");
18
19    r.push(CheckResult::pass("compile").with_duration_ms(120));
20    r.push(CheckResult::pass("test::math").with_duration_ms(7));
21
22    r.push(
23        CheckResult::fail("test::round_trip", Severity::Error)
24            .with_duration_ms(13)
25            .with_detail("expected 42, got 41"),
26    );
27
28    r.push(
29        CheckResult::fail("integration::startup", Severity::Critical)
30            .with_detail("service refused to start"),
31    );
32
33    r.push(
34        CheckResult::warn("style::trailing_ws", Severity::Warning)
35            .with_detail("3 trailing-whitespace warnings"),
36    );
37
38    r.push(CheckResult::skip("integration::network").with_detail("no network in sandbox"));
39
40    r.finish();
41
42    println!("{}", r.to_junit_xml());
43}
examples/schema_sample.rs (line 43)
21fn build_report(producer: &str) -> Report {
22    let frozen_start = chrono::Utc.with_ymd_and_hms(2026, 5, 11, 12, 0, 0).unwrap();
23    let frozen_end = chrono::Utc.with_ymd_and_hms(2026, 5, 11, 12, 0, 5).unwrap();
24
25    let mut r = Report::new("sample-subject", "0.9.3").with_producer(producer);
26    r.set_started_at(frozen_start);
27
28    // Pass with no detail, no severity, no tags, no evidence.
29    let mut c1 = CheckResult::pass("compile");
30    c1.at = frozen_start;
31    r.push(c1);
32
33    // Pass with a duration and a single numeric evidence.
34    let mut c2 = CheckResult::pass("bench::parse")
35        .with_duration_ms(7)
36        .with_tag("bench")
37        .with_evidence(Evidence::numeric("mean_ns", 1234.5))
38        .with_evidence(Evidence::numeric_int("iterations", 1_000_000));
39    c2.at = frozen_start;
40    r.push(c2);
41
42    // Warn with key-value evidence.
43    let mut c3 = CheckResult::warn("env::leaked", Severity::Warning)
44        .with_detail("RUST_LOG was set during test")
45        .with_evidence(Evidence::kv("env", [("CI", "true"), ("RUST_LOG", "debug")]));
46    c3.at = frozen_start;
47    r.push(c3);
48
49    // Fail with snippet + file_ref (no line range) + file_ref (with line range).
50    let mut c4 = CheckResult::fail("test::round_trip", Severity::Error)
51        .with_detail("expected 42, got 41")
52        .with_duration_ms(13)
53        .with_tags(["unit", "flaky"])
54        .with_evidence(Evidence::snippet(
55            "panic",
56            "assertion `left == right` failed",
57        ))
58        .with_evidence(Evidence::file_ref("source", "src/math.rs"))
59        .with_evidence(Evidence::file_ref_lines(
60            "call_site",
61            "tests/smoke.rs",
62            42,
63            47,
64        ));
65    c4.at = frozen_start;
66    r.push(c4);
67
68    // Fail with Critical severity.
69    let mut c5 = CheckResult::fail("integration::startup", Severity::Critical)
70        .with_detail("service refused to start");
71    c5.at = frozen_start;
72    r.push(c5);
73
74    // Warn with Info severity (lowest severity, still warn verdict).
75    let mut c6 = CheckResult::warn("style::trailing_ws", Severity::Info)
76        .with_detail("3 trailing-whitespace warnings");
77    c6.at = frozen_start;
78    r.push(c6);
79
80    // Skip with no severity.
81    let mut c7 = CheckResult::skip("integration::network").with_detail("no network in sandbox");
82    c7.at = frozen_start;
83    r.push(c7);
84
85    // Manually-constructed FileRef via Evidence::file_ref (covered above);
86    // also exercise a standalone FileRef with line_start but no line_end —
87    // valid per the schema (both are optional independently).
88    let mut c8 = CheckResult::pass("doc::link_check");
89    c8.at = frozen_start;
90    let standalone = FileRef::new("docs/index.md").with_line_range(10, 10);
91    c8 = c8.with_evidence(Evidence {
92        label: "anchor".into(),
93        data: dev_report::EvidenceData::FileRef(standalone),
94    });
95    r.push(c8);
96
97    r.set_finished_at(Some(frozen_end));
98    r
99}
Source

pub fn skip(name: impl Into<String>) -> Self

Build a skipped check result with the given name.

§Example
use dev_report::{CheckResult, Verdict};

let c = CheckResult::skip("not_applicable");
assert_eq!(c.verdict, Verdict::Skip);
Examples found in repository?
examples/sarif_export.rs (line 19)
15fn main() {
16    let mut r = Report::new("sample-subject", "0.9.3").with_producer("dev-bench");
17
18    r.push(CheckResult::pass("compile"));
19    r.push(CheckResult::skip("network"));
20
21    r.push(
22        CheckResult::fail("test::round_trip", Severity::Error)
23            .with_detail("expected 42, got 41")
24            .with_evidence(Evidence::file_ref_lines("site", "src/math.rs", 10, 12)),
25    );
26
27    r.push(
28        CheckResult::fail("integration::startup", Severity::Critical)
29            .with_detail("service refused to start")
30            .with_evidence(Evidence::file_ref("source", "src/bin/server.rs")),
31    );
32
33    r.push(
34        CheckResult::warn("style::trailing_ws", Severity::Warning)
35            .with_detail("3 trailing-whitespace warnings"),
36    );
37
38    r.finish();
39
40    println!("{}", r.to_sarif());
41}
More examples
Hide additional examples
examples/junit_export.rs (line 38)
16fn main() {
17    let mut r = Report::new("sample-subject", "0.9.3").with_producer("dev-bench");
18
19    r.push(CheckResult::pass("compile").with_duration_ms(120));
20    r.push(CheckResult::pass("test::math").with_duration_ms(7));
21
22    r.push(
23        CheckResult::fail("test::round_trip", Severity::Error)
24            .with_duration_ms(13)
25            .with_detail("expected 42, got 41"),
26    );
27
28    r.push(
29        CheckResult::fail("integration::startup", Severity::Critical)
30            .with_detail("service refused to start"),
31    );
32
33    r.push(
34        CheckResult::warn("style::trailing_ws", Severity::Warning)
35            .with_detail("3 trailing-whitespace warnings"),
36    );
37
38    r.push(CheckResult::skip("integration::network").with_detail("no network in sandbox"));
39
40    r.finish();
41
42    println!("{}", r.to_junit_xml());
43}
examples/schema_sample.rs (line 81)
21fn build_report(producer: &str) -> Report {
22    let frozen_start = chrono::Utc.with_ymd_and_hms(2026, 5, 11, 12, 0, 0).unwrap();
23    let frozen_end = chrono::Utc.with_ymd_and_hms(2026, 5, 11, 12, 0, 5).unwrap();
24
25    let mut r = Report::new("sample-subject", "0.9.3").with_producer(producer);
26    r.set_started_at(frozen_start);
27
28    // Pass with no detail, no severity, no tags, no evidence.
29    let mut c1 = CheckResult::pass("compile");
30    c1.at = frozen_start;
31    r.push(c1);
32
33    // Pass with a duration and a single numeric evidence.
34    let mut c2 = CheckResult::pass("bench::parse")
35        .with_duration_ms(7)
36        .with_tag("bench")
37        .with_evidence(Evidence::numeric("mean_ns", 1234.5))
38        .with_evidence(Evidence::numeric_int("iterations", 1_000_000));
39    c2.at = frozen_start;
40    r.push(c2);
41
42    // Warn with key-value evidence.
43    let mut c3 = CheckResult::warn("env::leaked", Severity::Warning)
44        .with_detail("RUST_LOG was set during test")
45        .with_evidence(Evidence::kv("env", [("CI", "true"), ("RUST_LOG", "debug")]));
46    c3.at = frozen_start;
47    r.push(c3);
48
49    // Fail with snippet + file_ref (no line range) + file_ref (with line range).
50    let mut c4 = CheckResult::fail("test::round_trip", Severity::Error)
51        .with_detail("expected 42, got 41")
52        .with_duration_ms(13)
53        .with_tags(["unit", "flaky"])
54        .with_evidence(Evidence::snippet(
55            "panic",
56            "assertion `left == right` failed",
57        ))
58        .with_evidence(Evidence::file_ref("source", "src/math.rs"))
59        .with_evidence(Evidence::file_ref_lines(
60            "call_site",
61            "tests/smoke.rs",
62            42,
63            47,
64        ));
65    c4.at = frozen_start;
66    r.push(c4);
67
68    // Fail with Critical severity.
69    let mut c5 = CheckResult::fail("integration::startup", Severity::Critical)
70        .with_detail("service refused to start");
71    c5.at = frozen_start;
72    r.push(c5);
73
74    // Warn with Info severity (lowest severity, still warn verdict).
75    let mut c6 = CheckResult::warn("style::trailing_ws", Severity::Info)
76        .with_detail("3 trailing-whitespace warnings");
77    c6.at = frozen_start;
78    r.push(c6);
79
80    // Skip with no severity.
81    let mut c7 = CheckResult::skip("integration::network").with_detail("no network in sandbox");
82    c7.at = frozen_start;
83    r.push(c7);
84
85    // Manually-constructed FileRef via Evidence::file_ref (covered above);
86    // also exercise a standalone FileRef with line_start but no line_end —
87    // valid per the schema (both are optional independently).
88    let mut c8 = CheckResult::pass("doc::link_check");
89    c8.at = frozen_start;
90    let standalone = FileRef::new("docs/index.md").with_line_range(10, 10);
91    c8 = c8.with_evidence(Evidence {
92        label: "anchor".into(),
93        data: dev_report::EvidenceData::FileRef(standalone),
94    });
95    r.push(c8);
96
97    r.set_finished_at(Some(frozen_end));
98    r
99}
Source

pub fn with_detail(self, detail: impl Into<String>) -> Self

Attach a human-readable detail to this check result.

§Example
use dev_report::CheckResult;

let c = CheckResult::pass("a").with_detail("ran in single thread");
assert_eq!(c.detail.as_deref(), Some("ran in single thread"));
Examples found in repository?
examples/sarif_export.rs (line 23)
15fn main() {
16    let mut r = Report::new("sample-subject", "0.9.3").with_producer("dev-bench");
17
18    r.push(CheckResult::pass("compile"));
19    r.push(CheckResult::skip("network"));
20
21    r.push(
22        CheckResult::fail("test::round_trip", Severity::Error)
23            .with_detail("expected 42, got 41")
24            .with_evidence(Evidence::file_ref_lines("site", "src/math.rs", 10, 12)),
25    );
26
27    r.push(
28        CheckResult::fail("integration::startup", Severity::Critical)
29            .with_detail("service refused to start")
30            .with_evidence(Evidence::file_ref("source", "src/bin/server.rs")),
31    );
32
33    r.push(
34        CheckResult::warn("style::trailing_ws", Severity::Warning)
35            .with_detail("3 trailing-whitespace warnings"),
36    );
37
38    r.finish();
39
40    println!("{}", r.to_sarif());
41}
More examples
Hide additional examples
examples/junit_export.rs (line 25)
16fn main() {
17    let mut r = Report::new("sample-subject", "0.9.3").with_producer("dev-bench");
18
19    r.push(CheckResult::pass("compile").with_duration_ms(120));
20    r.push(CheckResult::pass("test::math").with_duration_ms(7));
21
22    r.push(
23        CheckResult::fail("test::round_trip", Severity::Error)
24            .with_duration_ms(13)
25            .with_detail("expected 42, got 41"),
26    );
27
28    r.push(
29        CheckResult::fail("integration::startup", Severity::Critical)
30            .with_detail("service refused to start"),
31    );
32
33    r.push(
34        CheckResult::warn("style::trailing_ws", Severity::Warning)
35            .with_detail("3 trailing-whitespace warnings"),
36    );
37
38    r.push(CheckResult::skip("integration::network").with_detail("no network in sandbox"));
39
40    r.finish();
41
42    println!("{}", r.to_junit_xml());
43}
examples/schema_sample.rs (line 44)
21fn build_report(producer: &str) -> Report {
22    let frozen_start = chrono::Utc.with_ymd_and_hms(2026, 5, 11, 12, 0, 0).unwrap();
23    let frozen_end = chrono::Utc.with_ymd_and_hms(2026, 5, 11, 12, 0, 5).unwrap();
24
25    let mut r = Report::new("sample-subject", "0.9.3").with_producer(producer);
26    r.set_started_at(frozen_start);
27
28    // Pass with no detail, no severity, no tags, no evidence.
29    let mut c1 = CheckResult::pass("compile");
30    c1.at = frozen_start;
31    r.push(c1);
32
33    // Pass with a duration and a single numeric evidence.
34    let mut c2 = CheckResult::pass("bench::parse")
35        .with_duration_ms(7)
36        .with_tag("bench")
37        .with_evidence(Evidence::numeric("mean_ns", 1234.5))
38        .with_evidence(Evidence::numeric_int("iterations", 1_000_000));
39    c2.at = frozen_start;
40    r.push(c2);
41
42    // Warn with key-value evidence.
43    let mut c3 = CheckResult::warn("env::leaked", Severity::Warning)
44        .with_detail("RUST_LOG was set during test")
45        .with_evidence(Evidence::kv("env", [("CI", "true"), ("RUST_LOG", "debug")]));
46    c3.at = frozen_start;
47    r.push(c3);
48
49    // Fail with snippet + file_ref (no line range) + file_ref (with line range).
50    let mut c4 = CheckResult::fail("test::round_trip", Severity::Error)
51        .with_detail("expected 42, got 41")
52        .with_duration_ms(13)
53        .with_tags(["unit", "flaky"])
54        .with_evidence(Evidence::snippet(
55            "panic",
56            "assertion `left == right` failed",
57        ))
58        .with_evidence(Evidence::file_ref("source", "src/math.rs"))
59        .with_evidence(Evidence::file_ref_lines(
60            "call_site",
61            "tests/smoke.rs",
62            42,
63            47,
64        ));
65    c4.at = frozen_start;
66    r.push(c4);
67
68    // Fail with Critical severity.
69    let mut c5 = CheckResult::fail("integration::startup", Severity::Critical)
70        .with_detail("service refused to start");
71    c5.at = frozen_start;
72    r.push(c5);
73
74    // Warn with Info severity (lowest severity, still warn verdict).
75    let mut c6 = CheckResult::warn("style::trailing_ws", Severity::Info)
76        .with_detail("3 trailing-whitespace warnings");
77    c6.at = frozen_start;
78    r.push(c6);
79
80    // Skip with no severity.
81    let mut c7 = CheckResult::skip("integration::network").with_detail("no network in sandbox");
82    c7.at = frozen_start;
83    r.push(c7);
84
85    // Manually-constructed FileRef via Evidence::file_ref (covered above);
86    // also exercise a standalone FileRef with line_start but no line_end —
87    // valid per the schema (both are optional independently).
88    let mut c8 = CheckResult::pass("doc::link_check");
89    c8.at = frozen_start;
90    let standalone = FileRef::new("docs/index.md").with_line_range(10, 10);
91    c8 = c8.with_evidence(Evidence {
92        label: "anchor".into(),
93        data: dev_report::EvidenceData::FileRef(standalone),
94    });
95    r.push(c8);
96
97    r.set_finished_at(Some(frozen_end));
98    r
99}
Source

pub fn with_duration_ms(self, ms: u64) -> Self

Attach a duration measurement (milliseconds) to this check result.

§Example
use dev_report::CheckResult;

let c = CheckResult::pass("a").with_duration_ms(42);
assert_eq!(c.duration_ms, Some(42));
Examples found in repository?
examples/junit_export.rs (line 19)
16fn main() {
17    let mut r = Report::new("sample-subject", "0.9.3").with_producer("dev-bench");
18
19    r.push(CheckResult::pass("compile").with_duration_ms(120));
20    r.push(CheckResult::pass("test::math").with_duration_ms(7));
21
22    r.push(
23        CheckResult::fail("test::round_trip", Severity::Error)
24            .with_duration_ms(13)
25            .with_detail("expected 42, got 41"),
26    );
27
28    r.push(
29        CheckResult::fail("integration::startup", Severity::Critical)
30            .with_detail("service refused to start"),
31    );
32
33    r.push(
34        CheckResult::warn("style::trailing_ws", Severity::Warning)
35            .with_detail("3 trailing-whitespace warnings"),
36    );
37
38    r.push(CheckResult::skip("integration::network").with_detail("no network in sandbox"));
39
40    r.finish();
41
42    println!("{}", r.to_junit_xml());
43}
More examples
Hide additional examples
examples/schema_sample.rs (line 35)
21fn build_report(producer: &str) -> Report {
22    let frozen_start = chrono::Utc.with_ymd_and_hms(2026, 5, 11, 12, 0, 0).unwrap();
23    let frozen_end = chrono::Utc.with_ymd_and_hms(2026, 5, 11, 12, 0, 5).unwrap();
24
25    let mut r = Report::new("sample-subject", "0.9.3").with_producer(producer);
26    r.set_started_at(frozen_start);
27
28    // Pass with no detail, no severity, no tags, no evidence.
29    let mut c1 = CheckResult::pass("compile");
30    c1.at = frozen_start;
31    r.push(c1);
32
33    // Pass with a duration and a single numeric evidence.
34    let mut c2 = CheckResult::pass("bench::parse")
35        .with_duration_ms(7)
36        .with_tag("bench")
37        .with_evidence(Evidence::numeric("mean_ns", 1234.5))
38        .with_evidence(Evidence::numeric_int("iterations", 1_000_000));
39    c2.at = frozen_start;
40    r.push(c2);
41
42    // Warn with key-value evidence.
43    let mut c3 = CheckResult::warn("env::leaked", Severity::Warning)
44        .with_detail("RUST_LOG was set during test")
45        .with_evidence(Evidence::kv("env", [("CI", "true"), ("RUST_LOG", "debug")]));
46    c3.at = frozen_start;
47    r.push(c3);
48
49    // Fail with snippet + file_ref (no line range) + file_ref (with line range).
50    let mut c4 = CheckResult::fail("test::round_trip", Severity::Error)
51        .with_detail("expected 42, got 41")
52        .with_duration_ms(13)
53        .with_tags(["unit", "flaky"])
54        .with_evidence(Evidence::snippet(
55            "panic",
56            "assertion `left == right` failed",
57        ))
58        .with_evidence(Evidence::file_ref("source", "src/math.rs"))
59        .with_evidence(Evidence::file_ref_lines(
60            "call_site",
61            "tests/smoke.rs",
62            42,
63            47,
64        ));
65    c4.at = frozen_start;
66    r.push(c4);
67
68    // Fail with Critical severity.
69    let mut c5 = CheckResult::fail("integration::startup", Severity::Critical)
70        .with_detail("service refused to start");
71    c5.at = frozen_start;
72    r.push(c5);
73
74    // Warn with Info severity (lowest severity, still warn verdict).
75    let mut c6 = CheckResult::warn("style::trailing_ws", Severity::Info)
76        .with_detail("3 trailing-whitespace warnings");
77    c6.at = frozen_start;
78    r.push(c6);
79
80    // Skip with no severity.
81    let mut c7 = CheckResult::skip("integration::network").with_detail("no network in sandbox");
82    c7.at = frozen_start;
83    r.push(c7);
84
85    // Manually-constructed FileRef via Evidence::file_ref (covered above);
86    // also exercise a standalone FileRef with line_start but no line_end —
87    // valid per the schema (both are optional independently).
88    let mut c8 = CheckResult::pass("doc::link_check");
89    c8.at = frozen_start;
90    let standalone = FileRef::new("docs/index.md").with_line_range(10, 10);
91    c8 = c8.with_evidence(Evidence {
92        label: "anchor".into(),
93        data: dev_report::EvidenceData::FileRef(standalone),
94    });
95    r.push(c8);
96
97    r.set_finished_at(Some(frozen_end));
98    r
99}
Source

pub fn with_severity(self, severity: Severity) -> Self

Override the severity of this check result.

Useful when escalating or de-escalating a check after construction (e.g. promote a Warn+Warning to Warn+Error based on a config flag).

§Example
use dev_report::{CheckResult, Severity};

let c = CheckResult::warn("flaky", Severity::Warning)
    .with_severity(Severity::Error);
assert_eq!(c.severity, Some(Severity::Error));
Source

pub fn with_tag(self, tag: impl Into<String>) -> Self

Attach a single tag to this check result.

§Example
use dev_report::CheckResult;

let c = CheckResult::pass("compile").with_tag("slow");
assert!(c.has_tag("slow"));
Examples found in repository?
examples/schema_sample.rs (line 36)
21fn build_report(producer: &str) -> Report {
22    let frozen_start = chrono::Utc.with_ymd_and_hms(2026, 5, 11, 12, 0, 0).unwrap();
23    let frozen_end = chrono::Utc.with_ymd_and_hms(2026, 5, 11, 12, 0, 5).unwrap();
24
25    let mut r = Report::new("sample-subject", "0.9.3").with_producer(producer);
26    r.set_started_at(frozen_start);
27
28    // Pass with no detail, no severity, no tags, no evidence.
29    let mut c1 = CheckResult::pass("compile");
30    c1.at = frozen_start;
31    r.push(c1);
32
33    // Pass with a duration and a single numeric evidence.
34    let mut c2 = CheckResult::pass("bench::parse")
35        .with_duration_ms(7)
36        .with_tag("bench")
37        .with_evidence(Evidence::numeric("mean_ns", 1234.5))
38        .with_evidence(Evidence::numeric_int("iterations", 1_000_000));
39    c2.at = frozen_start;
40    r.push(c2);
41
42    // Warn with key-value evidence.
43    let mut c3 = CheckResult::warn("env::leaked", Severity::Warning)
44        .with_detail("RUST_LOG was set during test")
45        .with_evidence(Evidence::kv("env", [("CI", "true"), ("RUST_LOG", "debug")]));
46    c3.at = frozen_start;
47    r.push(c3);
48
49    // Fail with snippet + file_ref (no line range) + file_ref (with line range).
50    let mut c4 = CheckResult::fail("test::round_trip", Severity::Error)
51        .with_detail("expected 42, got 41")
52        .with_duration_ms(13)
53        .with_tags(["unit", "flaky"])
54        .with_evidence(Evidence::snippet(
55            "panic",
56            "assertion `left == right` failed",
57        ))
58        .with_evidence(Evidence::file_ref("source", "src/math.rs"))
59        .with_evidence(Evidence::file_ref_lines(
60            "call_site",
61            "tests/smoke.rs",
62            42,
63            47,
64        ));
65    c4.at = frozen_start;
66    r.push(c4);
67
68    // Fail with Critical severity.
69    let mut c5 = CheckResult::fail("integration::startup", Severity::Critical)
70        .with_detail("service refused to start");
71    c5.at = frozen_start;
72    r.push(c5);
73
74    // Warn with Info severity (lowest severity, still warn verdict).
75    let mut c6 = CheckResult::warn("style::trailing_ws", Severity::Info)
76        .with_detail("3 trailing-whitespace warnings");
77    c6.at = frozen_start;
78    r.push(c6);
79
80    // Skip with no severity.
81    let mut c7 = CheckResult::skip("integration::network").with_detail("no network in sandbox");
82    c7.at = frozen_start;
83    r.push(c7);
84
85    // Manually-constructed FileRef via Evidence::file_ref (covered above);
86    // also exercise a standalone FileRef with line_start but no line_end —
87    // valid per the schema (both are optional independently).
88    let mut c8 = CheckResult::pass("doc::link_check");
89    c8.at = frozen_start;
90    let standalone = FileRef::new("docs/index.md").with_line_range(10, 10);
91    c8 = c8.with_evidence(Evidence {
92        label: "anchor".into(),
93        data: dev_report::EvidenceData::FileRef(standalone),
94    });
95    r.push(c8);
96
97    r.set_finished_at(Some(frozen_end));
98    r
99}
Source

pub fn with_tags<I, S>(self, tags: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Attach many tags at once from any iterable of strings.

§Example
use dev_report::CheckResult;

let c = CheckResult::pass("compile").with_tags(["slow", "flaky"]);
assert!(c.has_tag("flaky"));
Examples found in repository?
examples/schema_sample.rs (line 53)
21fn build_report(producer: &str) -> Report {
22    let frozen_start = chrono::Utc.with_ymd_and_hms(2026, 5, 11, 12, 0, 0).unwrap();
23    let frozen_end = chrono::Utc.with_ymd_and_hms(2026, 5, 11, 12, 0, 5).unwrap();
24
25    let mut r = Report::new("sample-subject", "0.9.3").with_producer(producer);
26    r.set_started_at(frozen_start);
27
28    // Pass with no detail, no severity, no tags, no evidence.
29    let mut c1 = CheckResult::pass("compile");
30    c1.at = frozen_start;
31    r.push(c1);
32
33    // Pass with a duration and a single numeric evidence.
34    let mut c2 = CheckResult::pass("bench::parse")
35        .with_duration_ms(7)
36        .with_tag("bench")
37        .with_evidence(Evidence::numeric("mean_ns", 1234.5))
38        .with_evidence(Evidence::numeric_int("iterations", 1_000_000));
39    c2.at = frozen_start;
40    r.push(c2);
41
42    // Warn with key-value evidence.
43    let mut c3 = CheckResult::warn("env::leaked", Severity::Warning)
44        .with_detail("RUST_LOG was set during test")
45        .with_evidence(Evidence::kv("env", [("CI", "true"), ("RUST_LOG", "debug")]));
46    c3.at = frozen_start;
47    r.push(c3);
48
49    // Fail with snippet + file_ref (no line range) + file_ref (with line range).
50    let mut c4 = CheckResult::fail("test::round_trip", Severity::Error)
51        .with_detail("expected 42, got 41")
52        .with_duration_ms(13)
53        .with_tags(["unit", "flaky"])
54        .with_evidence(Evidence::snippet(
55            "panic",
56            "assertion `left == right` failed",
57        ))
58        .with_evidence(Evidence::file_ref("source", "src/math.rs"))
59        .with_evidence(Evidence::file_ref_lines(
60            "call_site",
61            "tests/smoke.rs",
62            42,
63            47,
64        ));
65    c4.at = frozen_start;
66    r.push(c4);
67
68    // Fail with Critical severity.
69    let mut c5 = CheckResult::fail("integration::startup", Severity::Critical)
70        .with_detail("service refused to start");
71    c5.at = frozen_start;
72    r.push(c5);
73
74    // Warn with Info severity (lowest severity, still warn verdict).
75    let mut c6 = CheckResult::warn("style::trailing_ws", Severity::Info)
76        .with_detail("3 trailing-whitespace warnings");
77    c6.at = frozen_start;
78    r.push(c6);
79
80    // Skip with no severity.
81    let mut c7 = CheckResult::skip("integration::network").with_detail("no network in sandbox");
82    c7.at = frozen_start;
83    r.push(c7);
84
85    // Manually-constructed FileRef via Evidence::file_ref (covered above);
86    // also exercise a standalone FileRef with line_start but no line_end —
87    // valid per the schema (both are optional independently).
88    let mut c8 = CheckResult::pass("doc::link_check");
89    c8.at = frozen_start;
90    let standalone = FileRef::new("docs/index.md").with_line_range(10, 10);
91    c8 = c8.with_evidence(Evidence {
92        label: "anchor".into(),
93        data: dev_report::EvidenceData::FileRef(standalone),
94    });
95    r.push(c8);
96
97    r.set_finished_at(Some(frozen_end));
98    r
99}
Source

pub fn has_tag(&self, tag: &str) -> bool

Return true if this check has the given tag.

§Example
use dev_report::CheckResult;

let c = CheckResult::pass("compile").with_tag("slow");
assert!(c.has_tag("slow"));
assert!(!c.has_tag("flaky"));
Source

pub fn with_evidence(self, e: Evidence) -> Self

Attach a single piece of Evidence to this check result.

§Example
use dev_report::{CheckResult, Evidence};

let c = CheckResult::pass("bench")
    .with_evidence(Evidence::numeric("mean_ns", 1234.0));
assert_eq!(c.evidence.len(), 1);
Examples found in repository?
examples/sarif_export.rs (line 24)
15fn main() {
16    let mut r = Report::new("sample-subject", "0.9.3").with_producer("dev-bench");
17
18    r.push(CheckResult::pass("compile"));
19    r.push(CheckResult::skip("network"));
20
21    r.push(
22        CheckResult::fail("test::round_trip", Severity::Error)
23            .with_detail("expected 42, got 41")
24            .with_evidence(Evidence::file_ref_lines("site", "src/math.rs", 10, 12)),
25    );
26
27    r.push(
28        CheckResult::fail("integration::startup", Severity::Critical)
29            .with_detail("service refused to start")
30            .with_evidence(Evidence::file_ref("source", "src/bin/server.rs")),
31    );
32
33    r.push(
34        CheckResult::warn("style::trailing_ws", Severity::Warning)
35            .with_detail("3 trailing-whitespace warnings"),
36    );
37
38    r.finish();
39
40    println!("{}", r.to_sarif());
41}
More examples
Hide additional examples
examples/schema_sample.rs (line 37)
21fn build_report(producer: &str) -> Report {
22    let frozen_start = chrono::Utc.with_ymd_and_hms(2026, 5, 11, 12, 0, 0).unwrap();
23    let frozen_end = chrono::Utc.with_ymd_and_hms(2026, 5, 11, 12, 0, 5).unwrap();
24
25    let mut r = Report::new("sample-subject", "0.9.3").with_producer(producer);
26    r.set_started_at(frozen_start);
27
28    // Pass with no detail, no severity, no tags, no evidence.
29    let mut c1 = CheckResult::pass("compile");
30    c1.at = frozen_start;
31    r.push(c1);
32
33    // Pass with a duration and a single numeric evidence.
34    let mut c2 = CheckResult::pass("bench::parse")
35        .with_duration_ms(7)
36        .with_tag("bench")
37        .with_evidence(Evidence::numeric("mean_ns", 1234.5))
38        .with_evidence(Evidence::numeric_int("iterations", 1_000_000));
39    c2.at = frozen_start;
40    r.push(c2);
41
42    // Warn with key-value evidence.
43    let mut c3 = CheckResult::warn("env::leaked", Severity::Warning)
44        .with_detail("RUST_LOG was set during test")
45        .with_evidence(Evidence::kv("env", [("CI", "true"), ("RUST_LOG", "debug")]));
46    c3.at = frozen_start;
47    r.push(c3);
48
49    // Fail with snippet + file_ref (no line range) + file_ref (with line range).
50    let mut c4 = CheckResult::fail("test::round_trip", Severity::Error)
51        .with_detail("expected 42, got 41")
52        .with_duration_ms(13)
53        .with_tags(["unit", "flaky"])
54        .with_evidence(Evidence::snippet(
55            "panic",
56            "assertion `left == right` failed",
57        ))
58        .with_evidence(Evidence::file_ref("source", "src/math.rs"))
59        .with_evidence(Evidence::file_ref_lines(
60            "call_site",
61            "tests/smoke.rs",
62            42,
63            47,
64        ));
65    c4.at = frozen_start;
66    r.push(c4);
67
68    // Fail with Critical severity.
69    let mut c5 = CheckResult::fail("integration::startup", Severity::Critical)
70        .with_detail("service refused to start");
71    c5.at = frozen_start;
72    r.push(c5);
73
74    // Warn with Info severity (lowest severity, still warn verdict).
75    let mut c6 = CheckResult::warn("style::trailing_ws", Severity::Info)
76        .with_detail("3 trailing-whitespace warnings");
77    c6.at = frozen_start;
78    r.push(c6);
79
80    // Skip with no severity.
81    let mut c7 = CheckResult::skip("integration::network").with_detail("no network in sandbox");
82    c7.at = frozen_start;
83    r.push(c7);
84
85    // Manually-constructed FileRef via Evidence::file_ref (covered above);
86    // also exercise a standalone FileRef with line_start but no line_end —
87    // valid per the schema (both are optional independently).
88    let mut c8 = CheckResult::pass("doc::link_check");
89    c8.at = frozen_start;
90    let standalone = FileRef::new("docs/index.md").with_line_range(10, 10);
91    c8 = c8.with_evidence(Evidence {
92        label: "anchor".into(),
93        data: dev_report::EvidenceData::FileRef(standalone),
94    });
95    r.push(c8);
96
97    r.set_finished_at(Some(frozen_end));
98    r
99}
Source

pub fn with_evidences<I>(self, items: I) -> Self
where I: IntoIterator<Item = Evidence>,

Attach many Evidence items at once from any iterable.

§Example
use dev_report::{CheckResult, Evidence};

let c = CheckResult::pass("bench").with_evidences([
    Evidence::numeric("mean_ns", 1234.0),
    Evidence::numeric("baseline_ns", 1100.0),
]);
assert_eq!(c.evidence.len(), 2);

Trait Implementations§

Source§

impl Clone for CheckResult

Source§

fn clone(&self) -> CheckResult

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CheckResult

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CheckResult

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for CheckResult

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,