pub struct HardwareMonitor { /* private fields */ }
Expand description
Real-time hardware monitor
Implementations§
Source§impl HardwareMonitor
impl HardwareMonitor
Sourcepub fn with_config(config: MonitoringConfig) -> Self
pub fn with_config(config: MonitoringConfig) -> Self
Create a new hardware monitor with custom configuration
Sourcepub async fn add_callback<T: MonitoringCallback + 'static>(&self, callback: T)
pub async fn add_callback<T: MonitoringCallback + 'static>(&self, callback: T)
Add a monitoring callback
Sourcepub async fn on_thermal_threshold<F>(&self, threshold: f32, _callback: F)
pub async fn on_thermal_threshold<F>(&self, threshold: f32, _callback: F)
Add a thermal threshold callback
Sourcepub async fn on_power_threshold<F>(&self, threshold: f32, _callback: F)
pub async fn on_power_threshold<F>(&self, threshold: f32, _callback: F)
Add a power threshold callback
Sourcepub fn subscribe(&self) -> Receiver<MonitoringEvent>
pub fn subscribe(&self) -> Receiver<MonitoringEvent>
Subscribe to monitoring events
Sourcepub async fn start_monitoring(&self) -> Result<()>
pub async fn start_monitoring(&self) -> Result<()>
Start monitoring in the background
Sourcepub async fn stop_monitoring(&self)
pub async fn stop_monitoring(&self)
Stop monitoring
Sourcepub async fn is_monitoring(&self) -> bool
pub async fn is_monitoring(&self) -> bool
Check if monitoring is currently running
Sourcepub async fn get_stats(&self) -> MonitoringStats
pub async fn get_stats(&self) -> MonitoringStats
Get current monitoring statistics
Sourcepub async fn get_last_hardware_info(&self) -> Option<HardwareInfo>
pub async fn get_last_hardware_info(&self) -> Option<HardwareInfo>
Get the last cached hardware information
Sourcepub async fn get_last_thermal_info(&self) -> Option<ThermalInfo>
pub async fn get_last_thermal_info(&self) -> Option<ThermalInfo>
Get the last cached thermal information
Sourcepub async fn get_last_power_profile(&self) -> Option<PowerProfile>
pub async fn get_last_power_profile(&self) -> Option<PowerProfile>
Get the last cached power profile
Sourcepub async fn update_config(&mut self, new_config: MonitoringConfig)
pub async fn update_config(&mut self, new_config: MonitoringConfig)
Update monitoring configuration
Sourcepub async fn clear_callbacks(&self)
pub async fn clear_callbacks(&self)
Clear all callbacks
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HardwareMonitor
impl !RefUnwindSafe for HardwareMonitor
impl Send for HardwareMonitor
impl Sync for HardwareMonitor
impl Unpin for HardwareMonitor
impl !UnwindSafe for HardwareMonitor
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