Skip to main content

View

Enum View 

Source
pub enum View {
    Table {
        title: String,
        columns: Vec<String>,
        rows: Vec<Vec<Json>>,
    },
    Chart {
        title: String,
        x_name: String,
        x: Vec<f64>,
        x_time: bool,
        series: Vec<(String, Vec<f64>)>,
    },
    Text {
        title: String,
        text: String,
    },
    Tiles {
        title: String,
        below: bool,
        tiles: Vec<View>,
    },
}
Expand description

What a run shows: a table, a chart, text, or tiles of those. A host may show tables as list tiles and charts as chart tiles, side by side for tiles.

Variants§

§

Table

Fields

§title: String
§columns: Vec<String>
§rows: Vec<Vec<Json>>
§

Chart

Fields

§title: String
§x_name: String
§x_time: bool
§series: Vec<(String, Vec<f64>)>
§

Text

Fields

§title: String
§text: String
§

Tiles

Fields

§title: String
§below: bool
§tiles: Vec<View>

Implementations§

Source§

impl View

Source

pub fn table(title: &str, columns: &[&str]) -> View

Source

pub fn row(self, values: Vec<Json>) -> View

Add a row (tables only).

Source

pub fn chart(title: &str) -> View

Source

pub fn x(self, name: &str, values: Vec<f64>, time: bool) -> View

The x axis (time: epoch milliseconds).

Source

pub fn line(self, name: &str, values: Vec<f64>) -> View

A line on the chart.

Source

pub fn text(title: &str, text: &str) -> View

Source

pub fn tiles(title: &str, below: bool, tiles: Vec<View>) -> View

Tiles side by side (below: stacked).

Source

pub fn to_json(&self) -> Json

Trait Implementations§

Source§

impl Clone for View

Source§

fn clone(&self) -> Self

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 View

Source§

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

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

impl PartialEq for View

Source§

fn eq(&self, other: &Self) -> bool

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for View

Auto Trait Implementations§

§

impl Forget for View

§

impl Freeze for View

§

impl Move for View

§

impl RefUnwindSafe for View

§

impl Send for View

§

impl Sync for View

§

impl Unpin for View

§

impl UnsafeUnpin for View

§

impl UnwindSafe for View

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.