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§
Sourcefn static_base() -> &'static strwhere
Self: Sized,
fn static_base() -> &'static strwhere
Self: Sized,
Returns this sensor’s base like “temp” or “fan”.
Sourcefn hwmon_path(&self) -> &Path
fn hwmon_path(&self) -> &Path
Returns this sensor’s hwmon’s path.
Provided Methods§
Sourcefn supported_read_sub_functions(&self) -> Vec<SensorSubFunctionType>
fn supported_read_sub_functions(&self) -> Vec<SensorSubFunctionType>
Returns a list of all readable subfunction types supported by this sensor.
Sourcefn subfunction_path(&self, sub_type: SensorSubFunctionType) -> PathBuf
fn subfunction_path(&self, sub_type: SensorSubFunctionType) -> PathBuf
Returns the path this sensor’s subfunction of the given type would have.