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§
Sourcefn capabilities(&self) -> PowerCapabilities
fn capabilities(&self) -> PowerCapabilities
What this backend can answer.
Sourcefn thermal_state(&self) -> PowerReading<ThermalState>
fn thermal_state(&self) -> PowerReading<ThermalState>
Current thermal pressure.
Sourcefn battery_status(&self) -> PowerReading<BatteryStatus>
fn battery_status(&self) -> PowerReading<BatteryStatus>
Current battery state.
Sourcefn unrestricted_background_work(&self) -> PowerReading<bool>
fn unrestricted_background_work(&self) -> PowerReading<bool>
Whether the OS permits unrestricted background execution for this app.
Sourcefn request_unrestricted_background_work(&self)
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".