Struct StatTileProps
pub struct StatTileProps {
pub key: String,
pub label: String,
pub value: String,
pub unit: Option<String>,
pub note: Option<String>,
pub change: Option<String>,
pub trend: Option<Trend>,
pub tone: Option<Tone>,
pub hero: bool,
pub samples: Vec<f64>,
pub selected: bool,
pub activate: Event,
}Expand description
One number and what it measures, on the content ground: a dashboard’s reading, a backup’s size. A tile reads top to bottom: its label, the value with its unit, a note, which way it moved, and a sparkline of its recent readings. A tile that opens a detail is pressed.
Fields§
§key: StringThe tile’s stable key in a group.
label: StringWhat the number measures, in sentence case: “Active users”.
value: StringThe number, as it reads: “1,284”, “99.9”.
unit: Option<String>Its unit, after the value: “GB”, “ms”.
note: Option<String>A neutral qualifier read with the value: “of 2 TB”, “estimated”.
change: Option<String>How it changed, beside an arrow of its trend: “12% this week”.
trend: Option<Trend>Which way it moved: up unless said, when it has a change. Whether that is good is its
tone, not the arrow.
tone: Option<Tone>The state of what it measures, as a ticker down its leading edge: a failed backup is danger, a healthy tunnel success.
hero: boolThe one hero number of a screen, set large.
samples: Vec<f64>Its recent readings, oldest first, as a sparkline under it.
selected: boolWhether it is the selected one, when it opens a detail.
activate: EventThe tile was pressed: open its detail.
Trait Implementations§
§impl Component for StatTileProps
impl Component for StatTileProps
fn describe() -> Description
§fn from_source(source: &mut dyn Source) -> Result<StatTileProps, Error>
fn from_source(source: &mut dyn Source) -> Result<StatTileProps, Error>
source gives. Read more§impl Default for StatTileProps
impl Default for StatTileProps
§fn default() -> StatTileProps
fn default() -> StatTileProps
Auto Trait Implementations§
impl Freeze for StatTileProps
impl !RefUnwindSafe for StatTileProps
impl !Send for StatTileProps
impl !Sync for StatTileProps
impl Unpin for StatTileProps
impl UnsafeUnpin for StatTileProps
impl !UnwindSafe for StatTileProps
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more