[][src]Trait libmedium::sensors::SensorBase

pub trait SensorBase {
    fn base(&self) -> &'static str;
fn index(&self) -> u16;
fn hwmon_path(&self) -> &Path; fn supported_read_sub_functions(&self) -> Vec<SensorSubFunctionType> { ... }
fn name(&self) -> String { ... }
fn read_raw(&self, sub_type: SensorSubFunctionType) -> Result<String, Error> { ... }
fn subfunction_path(&self, sub_type: SensorSubFunctionType) -> PathBuf { ... } }

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.

Loading content...

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.

Loading content...

Implementors

impl SensorBase for ReadOnlyCurr[src]

impl SensorBase for ReadOnlyEnergy[src]

impl SensorBase for ReadOnlyFan[src]

impl SensorBase for ReadOnlyHumidity[src]

impl SensorBase for ReadOnlyPower[src]

impl SensorBase for ReadOnlyPwm[src]

impl SensorBase for ReadOnlyTemp[src]

impl SensorBase for ReadOnlyVolt[src]

impl SensorBase for ReadWriteCurr[src]

impl SensorBase for ReadWriteEnergy[src]

impl SensorBase for ReadWriteFan[src]

impl SensorBase for ReadWriteHumidity[src]

impl SensorBase for ReadWritePower[src]

impl SensorBase for ReadWritePwm[src]

impl SensorBase for ReadWriteTemp[src]

impl SensorBase for ReadWriteVolt[src]

Loading content...