[−][src]Trait libmedium::sensors::WritableSensorBase
Base trait that all writable sensors must implement.
Provided methods
fn supported_write_sub_functions(&self) -> Vec<SensorSubFunctionType>
Returns a list of all writable subfunction types supported by this sensor.
fn write_raw(
&self,
sub_type: SensorSubFunctionType,
raw_value: &str
) -> Result<(), Error>
&self,
sub_type: SensorSubFunctionType,
raw_value: &str
) -> Result<(), Error>
Writes the given raw string value to this sensor's subfunction with the given type. You should usually prefer the specialized write functions like write_enable, because they ensure that no type mismatches occur. Returns an error, if this sensor doesn't support the subtype.
fn reset_history(&self) -> Result<(), Error>
Resets this sensor's history. Returns an error if this functionality is not supported by the sensor.
fn state(&self) -> Result<SensorState, Error>
Returns a SensorState struct that represents the state of all writable subfunctions of this sensor.
fn write_state(&self, state: &SensorState) -> Result<(), Error>
Writes the given state to this sensor. Returns an error and writes nothing if the given state contains one or more subfunctions that this sensor does not support.
fn write_state_lossy(&self, state: &SensorState) -> Result<(), Error>
Writes the given state to this sensor. All subfunction types contained in the given state that are not supported by this sensor will be ignored.