pub struct StatPaneData {
pub value: f64,
pub sparkline: Vec<f64>,
pub change_value: Option<f64>,
pub change_period: Option<String>,
pub thresholds: Vec<ThresholdConfig>,
pub error: Option<String>,
}Expand description
Data to display in a stat pane.
Fields§
§value: f64Current value to display
sparkline: Vec<f64>Sparkline data (recent history)
change_value: Option<f64>Change from previous period (percentage)
change_period: Option<String>Description of change period (e.g., “vs last hour”)
thresholds: Vec<ThresholdConfig>Thresholds for coloring the value
error: Option<String>Error message if fetch failed
Implementations§
Source§impl StatPaneData
impl StatPaneData
Sourcepub fn with_value(value: f64) -> Self
pub fn with_value(value: f64) -> Self
Create stat data with a value.
Sourcepub fn with_error(message: impl Into<String>) -> Self
pub fn with_error(message: impl Into<String>) -> Self
Create error result.
Sourcepub fn threshold(self, threshold: ThresholdConfig) -> Self
pub fn threshold(self, threshold: ThresholdConfig) -> Self
Add a threshold.
Trait Implementations§
Source§impl Clone for StatPaneData
impl Clone for StatPaneData
Source§fn clone(&self) -> StatPaneData
fn clone(&self) -> StatPaneData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StatPaneData
impl Debug for StatPaneData
Source§impl Default for StatPaneData
impl Default for StatPaneData
Source§impl PartialEq for StatPaneData
impl PartialEq for StatPaneData
impl StructuralPartialEq for StatPaneData
Auto Trait Implementations§
impl Freeze for StatPaneData
impl RefUnwindSafe for StatPaneData
impl Send for StatPaneData
impl Sync for StatPaneData
impl Unpin for StatPaneData
impl UnsafeUnpin for StatPaneData
impl UnwindSafe for StatPaneData
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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