pub struct Report<T> {
pub schema: u32,
pub command: Command,
pub captured_utc: Option<String>,
pub polls: Option<u32>,
pub elapsed_ms: Option<u64>,
pub ok: bool,
pub results: Vec<T>,
}Expand description
A command’s answer: the rows it produced, and whether they pass.
Generic over the row type rather than an enum of every command’s shape, so adding a command adds a row type instead of editing a type every existing consumer matches on.
Fields§
§schema: u32§command: Command§captured_utc: Option<String>When the frames behind this answer were taken. Absent for the
commands that do not capture — assert, and resolve without
--relocate. Supplied by the caller; this crate has no clock.
polls: Option<u32>How many times the screen was polled to reach this answer, and how
long that took. Present only for commands that loop — wait — and
provenance in the same sense captured_utc is: they describe how
the answer was obtained, never what it is.
elapsed_ms is measured rather than derived. wait decides when
to stop by counting polls, not by watching a clock, so the two do
not imply each other: capture time is real and is not budgeted.
elapsed_ms: Option<u64>§ok: boolThe aggregate the exit code mirrors: 0 when true, 1 when false.
Each command computes this from its own rows, in its own module. What makes a command report failure is the most important line it has, and it belongs where a reader will look for it rather than in a trait implementation five files away.
results: Vec<T>