pub struct ThermalMonitor { /* private fields */ }Expand description
Thermal monitor
Implementations§
Source§impl ThermalMonitor
impl ThermalMonitor
pub fn new() -> Self
Sourcepub fn battery_temp(&self) -> f64
pub fn battery_temp(&self) -> f64
Battery temperature in degrees Celsius.
Sourcepub fn ambient_temp(&self) -> f64
pub fn ambient_temp(&self) -> f64
Ambient (environmental) temperature in degrees Celsius.
Sourcepub fn state(&self) -> ThermalState
pub fn state(&self) -> ThermalState
Current thermal state classification.
Sourcepub fn update(&mut self, cpu: f64, gpu: f64, battery: f64, ambient: f64)
pub fn update(&mut self, cpu: f64, gpu: f64, battery: f64, ambient: f64)
Update thermal readings from platform sensors and reclassify the thermal state.
State thresholds (mobile SoC heuristic):
- CPU < 50°C →
Normal - CPU 50–70°C →
Warm - CPU 70–85°C →
Hot - CPU > 85°C →
Critical
Sourcepub fn apply_heat(&mut self, power_w: f64, duration: Duration)
pub fn apply_heat(&mut self, power_w: f64, duration: Duration)
Apply thermal impact from a computation that drew power_w watts
for duration. Increases CPU/GPU temperatures proportionally.
Auto Trait Implementations§
impl Freeze for ThermalMonitor
impl RefUnwindSafe for ThermalMonitor
impl Send for ThermalMonitor
impl Sync for ThermalMonitor
impl Unpin for ThermalMonitor
impl UnsafeUnpin for ThermalMonitor
impl UnwindSafe for ThermalMonitor
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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