pub struct PowerSchedule {
pub active_secs: u64,
pub saver_secs: u64,
pub critical_secs: u64,
pub saver_below: f32,
pub critical_below: f32,
}Expand description
How often a node samples as its battery drains, in plain seconds.
This is the serializable form of a PowerPlan: a
manifest carries the three work intervals as whole seconds and the two
state-of-charge thresholds, and plan assembles the
pamoja-power governor from them. The thresholds may be omitted from a manifest,
in which case they default to entering the saver cadence below 50% charge and the
critical cadence below 20%.
Fields§
§active_secs: u64Seconds between samples at a healthy charge.
saver_secs: u64Seconds between samples while conserving.
critical_secs: u64Seconds between samples when critically low.
saver_below: f32Enter the saver cadence below this state of charge.
critical_below: f32Enter the critical cadence below this state of charge.
Implementations§
Source§impl PowerSchedule
impl PowerSchedule
Sourcepub fn new(active_secs: u64, saver_secs: u64, critical_secs: u64) -> Self
pub fn new(active_secs: u64, saver_secs: u64, critical_secs: u64) -> Self
Creates a schedule from its three work intervals, with default thresholds.
§Arguments
active_secs- seconds between samples at a healthy charge.saver_secs- seconds between samples while conserving.critical_secs- seconds between samples when critically low.
§Returns
A schedule that enters the saver cadence below 50% charge and the critical cadence below 20%.
Sourcepub fn with_thresholds(self, saver_below: f32, critical_below: f32) -> Self
pub fn with_thresholds(self, saver_below: f32, critical_below: f32) -> Self
Trait Implementations§
Source§impl Clone for PowerSchedule
impl Clone for PowerSchedule
Source§fn clone(&self) -> PowerSchedule
fn clone(&self) -> PowerSchedule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PowerSchedule
Source§impl Debug for PowerSchedule
impl Debug for PowerSchedule
Source§impl<'de> Deserialize<'de> for PowerSchedule
impl<'de> Deserialize<'de> for PowerSchedule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for PowerSchedule
impl PartialEq for PowerSchedule
Source§fn eq(&self, other: &PowerSchedule) -> bool
fn eq(&self, other: &PowerSchedule) -> bool
self and other values to be equal, and is used by ==.