pub struct HwmonFileInfo {
    pub abspath: PathBuf,
    pub base: String,
    pub kind: SensorType,
    pub idx: usize,
}
Expand description

Summary info about a hwmon *_input file

Fields

abspath: PathBuf

The full absolute path of the file.

base: String

The filename with "_input" stripped off, e.g. "in1", "temp3", etc.

The separate allocation here is unfortunate, but AFAIK we can’t borrow from abspath without messing around with Pin and such.

kind: SensorType

The type of sensor the file reads from.

idx: usize

Just the numeric part of base, parsed out (mostly just for sorting).

Implementations

Construct a HwmonFileInfo from the given path.

Return the label associated with the file.

If a corresponding *_label file exists, this is obtained by reading from it; otherwise it’s just self’s base member.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.