pub struct DimensionThreshold {
pub dimension: HarmonyDimension,
pub advise_threshold: f32,
pub correct_threshold: f32,
pub intervene_threshold: f32,
pub high_is_bad: bool,
}Expand description
Threshold configuration for a single harmony dimension.
Fields§
§dimension: HarmonyDimensionThe dimension this threshold applies to.
advise_threshold: f32Advise when value crosses this.
correct_threshold: f32Correct when value crosses this.
intervene_threshold: f32Intervene when value crosses this.
high_is_bad: boolWhether the threshold is for high values (true) or low values (false).
Implementations§
Source§impl DimensionThreshold
impl DimensionThreshold
Sourcepub const fn high_is_bad(
dimension: HarmonyDimension,
advise: f32,
correct: f32,
intervene: f32,
) -> Self
pub const fn high_is_bad( dimension: HarmonyDimension, advise: f32, correct: f32, intervene: f32, ) -> Self
Create a threshold for a “high is bad” dimension (e.g., CPU load).
Sourcepub const fn low_is_bad(
dimension: HarmonyDimension,
advise: f32,
correct: f32,
intervene: f32,
) -> Self
pub const fn low_is_bad( dimension: HarmonyDimension, advise: f32, correct: f32, intervene: f32, ) -> Self
Create a threshold for a “low is bad” dimension (e.g., battery).
Sourcepub fn evaluate(&self, value: f32) -> ActionLevel
pub fn evaluate(&self, value: f32) -> ActionLevel
Determine the action level for a given value.
Trait Implementations§
Source§impl Clone for DimensionThreshold
impl Clone for DimensionThreshold
Source§impl Debug for DimensionThreshold
impl Debug for DimensionThreshold
Source§impl<'de> Deserialize<'de> for DimensionThreshold
impl<'de> Deserialize<'de> for DimensionThreshold
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
Auto Trait Implementations§
impl Freeze for DimensionThreshold
impl RefUnwindSafe for DimensionThreshold
impl Send for DimensionThreshold
impl Sync for DimensionThreshold
impl Unpin for DimensionThreshold
impl UnsafeUnpin for DimensionThreshold
impl UnwindSafe for DimensionThreshold
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