pub struct Run {
pub schema: String,
pub origin: String,
pub complete: bool,
pub source: BTreeMap<String, String>,
pub breakpoints: Vec<u32>,
pub viewports: Vec<u32>,
pub surfaces: Vec<Surface>,
pub foreign: Vec<Foreign>,
pub pages: usize,
pub visits: usize,
pub seconds: u64,
pub findings: Vec<Finding>,
}Expand description
A whole audit run.
Fields§
§schema: StringThe contract of this document.
origin: StringThe origin the audit drove.
complete: boolWhether every discovered page was visited, or the run was narrowed for iteration.
source: BTreeMap<String, String>Where the pages and the widths came from.
breakpoints: Vec<u32>The breakpoints the compiled stylesheet declared.
viewports: Vec<u32>The widths the sweep visits.
surfaces: Vec<Surface>Every surface the run measured, and what each contributed.
foreign: Vec<Foreign>Every subtree the engine was told to skip, once per declaration.
pages: usizeHow many pages were visited.
visits: usizeHow many page-and-width visits that came to.
seconds: u64How long the run took, in whole seconds.
findings: Vec<Finding>Every finding, in the order the run produced them.
Implementations§
Source§impl Run
impl Run
Sourcepub fn by_rule(&self) -> Vec<(String, usize)>
pub fn by_rule(&self) -> Vec<(String, usize)>
The findings per rule, most frequent first, then by rule name.
Derived rather than read from the document: a count and a list that can disagree is a report that will one day lie about its own evidence.
use majordomus_cli::web::report::ui::parse;
let run = parse(r#"{"schema":"ui-audit/v1","pages":1,"visits":1,"findings":[
{"route":"/","width":320,"rule":"a","detail":"x"},
{"route":"/","width":320,"rule":"a","detail":"y"},
{"route":"/","width":320,"rule":"b","detail":"z"}]}"#).unwrap();
assert_eq!(run.by_rule(), vec![("a".to_string(), 2), ("b".to_string(), 1)]);