pub trait WriteablePowerSensor: PowerSensor + WriteableSensor {
// Provided methods
fn write_cap(&self, cap: Power) -> Result<(), Error> { ... }
fn write_cap_hyst(&self, cap_hyst: Power) -> Result<(), Error> { ... }
fn write_average_interval(&self, interval: Duration) -> Result<(), Error> { ... }
fn write_enable(&self, enable: bool) -> Result<(), Error> { ... }
fn write_max(&self, max: Power) -> Result<(), Error> { ... }
fn write_crit(&self, crit: Power) -> Result<(), Error> { ... }
fn write_beep(&self, beep: bool) -> Result<(), Error> { ... }
}Expand description
Helper trait that sums up all functionality of a read-write power sensor.
Provided Methods§
Sourcefn write_cap(&self, cap: Power) -> Result<(), Error>
fn write_cap(&self, cap: Power) -> Result<(), Error>
Converts cap and writes it to the cap subfunction of this power sensor. Returns an error, if this sensor doesn’t support the subfunction.
Sourcefn write_cap_hyst(&self, cap_hyst: Power) -> Result<(), Error>
fn write_cap_hyst(&self, cap_hyst: Power) -> Result<(), Error>
Converts cap_hyst and writes it to the cap_hyst subfunction of this power sensor. Returns an error, if this sensor doesn’t support the subfunction.
Sourcefn write_average_interval(&self, interval: Duration) -> Result<(), Error>
fn write_average_interval(&self, interval: Duration) -> Result<(), Error>
Converts interval and writes it to the average_interval subfunction of this power sensor. Returns an error, if this sensor doesn’t support the subfunction.
Sourcefn write_enable(&self, enable: bool) -> Result<(), Error>
fn write_enable(&self, enable: bool) -> Result<(), Error>
Sets this sensor’s enabled state. Returns an error, if the sensor doesn’t support the feature.
Sourcefn write_max(&self, max: Power) -> Result<(), Error>
fn write_max(&self, max: Power) -> Result<(), Error>
Writes this sensor’s max value. Returns an error, if the sensor doesn’t support the feature.