pub struct HealthIndicator {
pub name: String,
pub score: f64,
pub evidence: HashMap<String, f64>,
pub description: String,
}Expand description
A scalar health indicator computed from one or more sensor time-series.
score is in [0, 1]: 1.0 = perfect health, 0.0 = complete failure.
Fields§
§name: StringName of the indicator (e.g. “vibration_rms”).
score: f64Computed health score ∈ [0, 1].
evidence: HashMap<String, f64>Supporting evidence (sensor name → raw value).
description: StringNarrative description.
Implementations§
Source§impl HealthIndicator
impl HealthIndicator
Sourcepub fn from_vibration(
samples: &[f64],
nominal_rms: f64,
failure_rms: f64,
) -> PhysicsResult<Self>
pub fn from_vibration( samples: &[f64], nominal_rms: f64, failure_rms: f64, ) -> PhysicsResult<Self>
Compute a vibration RMS health indicator.
samples is a slice of acceleration samples (m/s²).
nominal_rms is the expected RMS in healthy conditions.
failure_rms is the RMS at which the component is considered failed.
Sourcepub fn from_temperature(
temperature: f64,
nominal_temp: f64,
max_temp: f64,
) -> PhysicsResult<Self>
pub fn from_temperature( temperature: f64, nominal_temp: f64, max_temp: f64, ) -> PhysicsResult<Self>
Compute a temperature-based health indicator.
temperature in Kelvin. Healthy below nominal_temp; failed at max_temp.
Sourcepub fn from_pressure(
pressure: f64,
nominal_pa: f64,
max_pa: f64,
) -> PhysicsResult<Self>
pub fn from_pressure( pressure: f64, nominal_pa: f64, max_pa: f64, ) -> PhysicsResult<Self>
Compute a pressure-based health indicator.
Sourcepub fn aggregate(indicators: &[HealthIndicator]) -> PhysicsResult<Self>
pub fn aggregate(indicators: &[HealthIndicator]) -> PhysicsResult<Self>
Aggregate multiple indicators into one composite score (arithmetic mean).
Trait Implementations§
Source§impl Clone for HealthIndicator
impl Clone for HealthIndicator
Source§fn clone(&self) -> HealthIndicator
fn clone(&self) -> HealthIndicator
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 HealthIndicator
impl Debug for HealthIndicator
Source§impl<'de> Deserialize<'de> for HealthIndicator
impl<'de> Deserialize<'de> for HealthIndicator
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 HealthIndicator
impl RefUnwindSafe for HealthIndicator
impl Send for HealthIndicator
impl Sync for HealthIndicator
impl Unpin for HealthIndicator
impl UnsafeUnpin for HealthIndicator
impl UnwindSafe for HealthIndicator
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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