Skip to main content

PowerMonitor

Trait PowerMonitor 

Source
pub trait PowerMonitor: Send + Sync {
    // Provided methods
    fn capabilities(&self) -> PowerCapabilities { ... }
    fn thermal_state(&self) -> PowerReading<ThermalState> { ... }
    fn battery_status(&self) -> PowerReading<BatteryStatus> { ... }
    fn unrestricted_background_work(&self) -> PowerReading<bool> { ... }
    fn request_unrestricted_background_work(&self) { ... }
}
Expand description

Platform power policy.

Provided Methods§

Source

fn capabilities(&self) -> PowerCapabilities

What this backend can answer.

Source

fn thermal_state(&self) -> PowerReading<ThermalState>

Current thermal pressure.

Source

fn battery_status(&self) -> PowerReading<BatteryStatus>

Current battery state.

Source

fn unrestricted_background_work(&self) -> PowerReading<bool>

Whether the OS permits unrestricted background execution for this app.

Source

fn request_unrestricted_background_work(&self)

Opens the platform UI where the user can allow background execution.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§