#[non_exhaustive]pub struct WidgetConditionalFormat {
pub comparator: WidgetComparator,
pub custom_bg_color: Option<String>,
pub custom_fg_color: Option<String>,
pub hide_value: Option<bool>,
pub image_url: Option<String>,
pub metric: Option<String>,
pub palette: WidgetPalette,
pub timeframe: Option<String>,
pub value: f64,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Define a conditional format for the widget.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.comparator: WidgetComparator
Comparator to apply.
custom_bg_color: Option<String>
Color palette to apply to the background, same values available as palette.
custom_fg_color: Option<String>
Color palette to apply to the foreground, same values available as palette.
hide_value: Option<bool>
True hides values.
image_url: Option<String>
Displays an image as the background.
metric: Option<String>
Metric from the request to correlate this conditional format with.
palette: WidgetPalette
Color palette to apply.
timeframe: Option<String>
Defines the displayed timeframe.
value: f64
Value for the comparator.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl WidgetConditionalFormat
impl WidgetConditionalFormat
pub fn new( comparator: WidgetComparator, palette: WidgetPalette, value: f64, ) -> WidgetConditionalFormat
pub fn custom_bg_color(self, value: String) -> Self
pub fn custom_fg_color(self, value: String) -> Self
pub fn hide_value(self, value: bool) -> Self
pub fn image_url(self, value: String) -> Self
pub fn metric(self, value: String) -> Self
pub fn timeframe(self, value: String) -> Self
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for WidgetConditionalFormat
impl Clone for WidgetConditionalFormat
Source§fn clone(&self) -> WidgetConditionalFormat
fn clone(&self) -> WidgetConditionalFormat
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 WidgetConditionalFormat
impl Debug for WidgetConditionalFormat
Source§impl<'de> Deserialize<'de> for WidgetConditionalFormat
impl<'de> Deserialize<'de> for WidgetConditionalFormat
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for WidgetConditionalFormat
impl PartialEq for WidgetConditionalFormat
Source§impl Serialize for WidgetConditionalFormat
impl Serialize for WidgetConditionalFormat
impl StructuralPartialEq for WidgetConditionalFormat
Auto Trait Implementations§
impl Freeze for WidgetConditionalFormat
impl RefUnwindSafe for WidgetConditionalFormat
impl Send for WidgetConditionalFormat
impl Sync for WidgetConditionalFormat
impl Unpin for WidgetConditionalFormat
impl UnwindSafe for WidgetConditionalFormat
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