Skip to main content

Viz

Enum Viz 

pub enum Viz {
Show 15 variants Spark, Gauge, Dial, Bar, Thermometer, Droplet, Battery, Wind, Sun, Wave, Switch, Valve, Chain, Mesh, Count,
}
Expand description

The graphic a reading is drawn with on the dashboard.

The names are the instrument, not the quantity, so a profile chooses the shape that reads best for its data: a 270-degree arch Gauge for a fraction, a Bar for a tank, a Switch for an on/off state. Each maps to one of the dashboard’s hand-drawn visualizations through kind.

Variants§

§

Spark

A rolling sparkline of recent values. The default for an unfamiliar quantity.

§

Gauge

A 270-degree arch gauge, for a fraction or percentage.

§

Dial

A half-dial with a needle, for a pressure or flow reading.

§

Bar

A horizontal bar with a safe-band tick, for a level or stock.

§

Thermometer

A thermometer, for a temperature.

§

Droplet

A liquid-filled droplet, for humidity or moisture.

§

Battery

A segmented battery cell, for a state of charge or voltage.

§

Wind

An anemometer, for wind speed.

§

Sun

A sun whose corona grows with the reading, for illuminance.

§

Wave

An acoustic waveform, for sound level or an acoustic event.

§

Switch

A labelled state chip, lit when the state reads as “on”. For a discrete state.

§

Valve

A pipe valve, open along the flow or closed across it. For a controllable valve.

§

Chain

A row of hash-chained blocks, for a tamper-evident record count.

§

Mesh

A neighbour-mesh topology map, for a mesh node’s peers.

§

Count

A plain numeric counter, for a node or network stat.

Implementations§

§

impl Viz

pub const ALL: [Viz; 15]

Every graphic, in a stable order, so a caller can enumerate the available visualizations (and a build can check each one still renders).

pub fn kind(self) -> &'static str

Returns the dashboard visualization kind this graphic renders as.

The dashboard’s renderer dispatches on a small set of internal kind strings; a few friendly names differ from them (Gauge draws the radial arch, Thermometer the therm instrument, Switch the chip). This is the value carried on the wire so the page needs no lookup of its own.

§Returns

The stable visualization kind, such as "radial" or "bar".

Trait Implementations§

§

impl Clone for Viz

§

fn clone(&self) -> Viz

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
§

impl Copy for Viz

§

impl Debug for Viz

§

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

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for Viz

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Viz, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Eq for Viz

§

impl PartialEq for Viz

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Serialize for Viz

§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl StructuralPartialEq for Viz

Auto Trait Implementations§

§

impl Freeze for Viz

§

impl RefUnwindSafe for Viz

§

impl Send for Viz

§

impl Sync for Viz

§

impl Unpin for Viz

§

impl UnsafeUnpin for Viz

§

impl UnwindSafe for Viz

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.