Trait Sensor

Source
pub trait Sensor {
    // Required methods
    fn static_base() -> &'static str
       where Self: Sized;
    fn base(&self) -> &'static str;
    fn index(&self) -> u16;
    fn hwmon_path(&self) -> &Path;

    // Provided methods
    fn supported_read_sub_functions(&self) -> Vec<SensorSubFunctionType> { ... }
    fn subfunction_path(&self, sub_type: SensorSubFunctionType) -> PathBuf { ... }
}
Expand description

Base trait that all sensors must implement. It contains the functionality to get a sensor’s base, index or supported subfunctions.

Required Methods§

Source

fn static_base() -> &'static str
where Self: Sized,

Returns this sensor’s base like “temp” or “fan”.

Source

fn base(&self) -> &'static str

Returns this sensor’s base like “temp” or “fan”.

Source

fn index(&self) -> u16

Returns this sensor’s index.

Source

fn hwmon_path(&self) -> &Path

Returns this sensor’s hwmon’s path.

Provided Methods§

Source

fn supported_read_sub_functions(&self) -> Vec<SensorSubFunctionType>

Returns a list of all readable subfunction types supported by this sensor.

Source

fn subfunction_path(&self, sub_type: SensorSubFunctionType) -> PathBuf

Returns the path this sensor’s subfunction of the given type would have.

Implementors§