[−][src]Trait libmedium::sensors::SensorBase
Base trait that all sensors must implement. It contains the functionality to get a sensor's name, index or supported subfunctions.
Required methods
fn base(&self) -> &'static str
Returns this sensor's base like "temp" or "fan".
fn index(&self) -> u16
Returns this sensor's index.
fn hwmon_path(&self) -> &Path
Returns this sensor's hwmon's path.
Provided methods
fn supported_read_sub_functions(&self) -> Vec<SensorSubFunctionType>
Returns a list of all readable subfunction types supported by this sensor.
fn name(&self) -> String
If this sensor has a label, its contents are returned. Otherwise a plain sensor descriptor is returned.
fn read_raw(&self, sub_type: SensorSubFunctionType) -> Result<String, Error>
Reads this sensor's subfunction with the given type and returns its value as a raw string. You should usually prefer the specialized read functions like read_input, because they automatically convert the read value to the right type. Returns an error, if this sensor doesn't support the subtype.
fn subfunction_path(&self, sub_type: SensorSubFunctionType) -> PathBuf
Returns the path this sensor's subfunction of the given type would have.