pub struct DiagnosticReport {
pub checks: Vec<CheckResult>,
pub passed_count: usize,
pub failed_count: usize,
pub known_limitations: Vec<KnownLimitation>,
pub transport: Option<TransportDiagnostic>,
pub transport_realism: Option<TransportRealismReport>,
pub integrity_canary: Option<IntegrityCanaryReport>,
}Expand description
Aggregate result from running all detection checks.
§Example
use stygian_browser::diagnostic::{all_checks, DiagnosticReport};
let results = all_checks()
.iter()
.map(|c| c.parse_output(r#"{"passed":true,"details":"ok"}"#))
.collect::<Vec<_>>();
let report = DiagnosticReport::new(results);
assert!(report.is_clean());
assert!((report.coverage_pct() - 100.0).abs() < 0.001);Fields§
§checks: Vec<CheckResult>Individual check results in catalogue order.
passed_count: usizeNumber of checks where passed == true.
failed_count: usizeNumber of checks where passed == false.
known_limitations: Vec<KnownLimitation>Browser surfaces observed at runtime that are not yet covered fully.
transport: Option<TransportDiagnostic>Optional transport-layer diagnostics (JA3/JA4/HTTP3 perk).
transport_realism: Option<TransportRealismReport>Optional transport-realism score (T82). Backward-compatible
additive field: omitted from JSON when None, present (as
an object) when transport-realism scoring ran. See
crate::transport_realism::TransportRealismReport for
the schema.
integrity_canary: Option<IntegrityCanaryReport>Optional integrity canary report (T92). Backward-compatible
additive field: omitted from JSON when None, present (as
an object) when integrity canary scoring ran. Carries the
aggregate risk score, Suspected/Confirmed classification,
per-probe findings, and aggregated mitigation hints. See
crate::integrity_canary::IntegrityCanaryReport for the
schema.
Implementations§
Source§impl DiagnosticReport
impl DiagnosticReport
Sourcepub fn new(checks: Vec<CheckResult>) -> Self
pub fn new(checks: Vec<CheckResult>) -> Self
Build a report from an ordered list of check results.
Sourcepub fn with_known_limitations(
self,
known_limitations: Vec<KnownLimitation>,
) -> Self
pub fn with_known_limitations( self, known_limitations: Vec<KnownLimitation>, ) -> Self
Attach known browser-surface limitations to this report.
Sourcepub fn with_transport(self, transport: TransportDiagnostic) -> Self
pub fn with_transport(self, transport: TransportDiagnostic) -> Self
Attach transport diagnostics to this report.
Sourcepub fn with_transport_realism(
self,
transport_realism: TransportRealismReport,
) -> Self
pub fn with_transport_realism( self, transport_realism: TransportRealismReport, ) -> Self
Attach transport-realism diagnostics (T82) to this report.
Backward-compatible: the field is omitted from JSON when the
supplied report would otherwise be None and the rest of the
DiagnosticReport schema is unchanged.
Sourcepub fn with_integrity_canary(
self,
integrity_canary: IntegrityCanaryReport,
) -> Self
pub fn with_integrity_canary( self, integrity_canary: IntegrityCanaryReport, ) -> Self
Attach integrity canary diagnostics (T92) to this report.
Backward-compatible: the field is omitted from JSON when the
supplied report would otherwise be None and the rest of the
DiagnosticReport schema is unchanged.
Sourcepub fn coverage_pct(&self) -> f64
pub fn coverage_pct(&self) -> f64
Percentage of checks that passed (0.0–100.0).
Sourcepub fn failures(&self) -> impl Iterator<Item = &CheckResult>
pub fn failures(&self) -> impl Iterator<Item = &CheckResult>
Iterate over all checks that returned passed: false.
Trait Implementations§
Source§impl Clone for DiagnosticReport
impl Clone for DiagnosticReport
Source§fn clone(&self) -> DiagnosticReport
fn clone(&self) -> DiagnosticReport
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more