Struct omnisensor::sysfs::HwmonFileInfo
source · [−]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: PathBufThe full absolute path of the file.
base: StringThe 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: SensorTypeThe type of sensor the file reads from.
idx: usizeJust the numeric part of base, parsed out (mostly just for sorting).
Implementations
sourceimpl HwmonFileInfo
impl HwmonFileInfo
sourcepub fn from_abspath(abspath: PathBuf) -> Result<Self, Box<dyn Error>>
pub fn from_abspath(abspath: PathBuf) -> Result<Self, Box<dyn Error>>
Construct a HwmonFileInfo from the given path.
Auto Trait Implementations
impl RefUnwindSafe for HwmonFileInfo
impl Send for HwmonFileInfo
impl Sync for HwmonFileInfo
impl Unpin for HwmonFileInfo
impl UnwindSafe for HwmonFileInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more