Skip to main content

Report

Struct Report 

Source
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: bool

The 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>

Implementations§

Source§

impl<T> Report<T>

Source

pub fn captured( command: Command, captured_utc: String, ok: bool, results: Vec<T>, ) -> Self

A document from a command that captured.

Source

pub fn offline(command: Command, ok: bool, results: Vec<T>) -> Self

A document from a command that answered from the session alone.

Trait Implementations§

Source§

impl<T: Clone> Clone for Report<T>

Source§

fn clone(&self) -> Report<T>

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<T: Debug> Debug for Report<T>

Source§

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

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

impl<T: PartialEq> PartialEq for Report<T>

Source§

fn eq(&self, other: &Report<T>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T> Serialize for Report<T>
where T: Serialize,

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
Source§

impl<T: PartialEq> StructuralPartialEq for Report<T>

Auto Trait Implementations§

§

impl<T> Freeze for Report<T>

§

impl<T> RefUnwindSafe for Report<T>
where T: RefUnwindSafe,

§

impl<T> Send for Report<T>
where T: Send,

§

impl<T> Sync for Report<T>
where T: Sync,

§

impl<T> Unpin for Report<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for Report<T>

§

impl<T> UnwindSafe for Report<T>
where T: UnwindSafe,

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.