pub struct ThresholdZone {
pub above: f64,
pub color: Color,
}Expand description
A threshold zone with a color and breakpoint.
Threshold zones define color changes based on the gauge’s current
percentage. When the gauge percentage is at or above the above value,
and below any higher threshold, this zone’s color is used.
§Example
use envision::component::ThresholdZone;
use ratatui::style::Color;
let zone = ThresholdZone {
above: 0.7,
color: Color::Yellow,
};
assert_eq!(zone.above, 0.7);
assert_eq!(zone.color, Color::Yellow);Fields§
§above: f64Values at or above this percentage trigger this zone’s color.
color: ColorThe color for this zone.
Trait Implementations§
Source§impl Clone for ThresholdZone
impl Clone for ThresholdZone
Source§fn clone(&self) -> ThresholdZone
fn clone(&self) -> ThresholdZone
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 ThresholdZone
impl Debug for ThresholdZone
Source§impl<'de> Deserialize<'de> for ThresholdZone
impl<'de> Deserialize<'de> for ThresholdZone
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 ThresholdZone
impl PartialEq for ThresholdZone
Source§impl Serialize for ThresholdZone
impl Serialize for ThresholdZone
impl StructuralPartialEq for ThresholdZone
Auto Trait Implementations§
impl Freeze for ThresholdZone
impl RefUnwindSafe for ThresholdZone
impl Send for ThresholdZone
impl Sync for ThresholdZone
impl Unpin for ThresholdZone
impl UnsafeUnpin for ThresholdZone
impl UnwindSafe for ThresholdZone
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