pub struct PowerState {
pub thermal: PowerReading<ThermalState>,
pub battery: PowerReading<BatteryStatus>,
pub unrestricted_background_work: PowerReading<bool>,
}Expand description
Everything the platform currently says about power.
Fields§
§thermal: PowerReading<ThermalState>Current thermal pressure.
battery: PowerReading<BatteryStatus>Current battery state.
unrestricted_background_work: PowerReading<bool>Whether the OS permits unrestricted background execution.
Implementations§
Source§impl PowerState
impl PowerState
Sourcepub const fn unsupported() -> Self
pub const fn unsupported() -> Self
The state a platform with no power APIs reports.
Sourcepub fn should_pause_work(&self) -> bool
pub fn should_pause_work(&self) -> bool
Whether sustained work should stop. A platform that cannot measure heat never says stop, because guessing would starve every desktop build.
Trait Implementations§
Source§impl Clone for PowerState
impl Clone for PowerState
impl Copy for PowerState
Source§impl Debug for PowerState
impl Debug for PowerState
impl Eq for PowerState
Source§impl PartialEq for PowerState
impl PartialEq for PowerState
impl StructuralPartialEq for PowerState
Auto Trait Implementations§
impl Freeze for PowerState
impl RefUnwindSafe for PowerState
impl Send for PowerState
impl Sync for PowerState
impl Unpin for PowerState
impl UnsafeUnpin for PowerState
impl UnwindSafe for PowerState
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