pub struct SysPath { /* private fields */ }
Expand description
sysfs root
Implementations§
Source§impl SysPath
impl SysPath
Sourcepub fn path(root: impl AsRef<Path>) -> Self
pub fn path(root: impl AsRef<Path>) -> Self
Initialize with a custom root.
Use SysPath::default() to use the default root /
.
Sourcepub fn entities(&self) -> Result<impl Iterator<Item = Result<EntityPath>> + '_>
pub fn entities(&self) -> Result<impl Iterator<Item = Result<EntityPath>> + '_>
Get all entities in the system
Sourcepub fn hwmon_by_name(&self, name: &str) -> Result<HwMonPath>
pub fn hwmon_by_name(&self, name: &str) -> Result<HwMonPath>
Find a hardware monitor entry by name
Sourcepub fn hwmon_by_index(&self, index: u64) -> HwMonPath
pub fn hwmon_by_index(&self, index: u64) -> HwMonPath
Find a hardware monitor entry by index
Sourcepub fn hwmon(
&self,
c: impl Capabilities<HwMonAttribute, HwMonPath>,
) -> Result<impl Iterator<Item = HwMonPath>>
pub fn hwmon( &self, c: impl Capabilities<HwMonAttribute, HwMonPath>, ) -> Result<impl Iterator<Item = HwMonPath>>
Find a hardware monitor by capabilities
Sourcepub fn power_supply_by_name(&self, name: &str) -> PowerSupplyPath
pub fn power_supply_by_name(&self, name: &str) -> PowerSupplyPath
Find a power supply entry by name
Sourcepub fn power_supply(
&self,
c: impl Capabilities<PowerSupplyAttribute, PowerSupplyPath>,
) -> Result<impl Iterator<Item = PowerSupplyPath>>
pub fn power_supply( &self, c: impl Capabilities<PowerSupplyAttribute, PowerSupplyPath>, ) -> Result<impl Iterator<Item = PowerSupplyPath>>
Find a power supply by capabilities
Sourcepub fn class(
&self,
class: impl AsRef<Path>,
c: impl Capabilities<String, BasicEntityPath>,
) -> Result<impl Iterator<Item = BasicEntityPath>>
pub fn class( &self, class: impl AsRef<Path>, c: impl Capabilities<String, BasicEntityPath>, ) -> Result<impl Iterator<Item = BasicEntityPath>>
Find entities in a sysfs class by capabilities
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SysPath
impl RefUnwindSafe for SysPath
impl Send for SysPath
impl Sync for SysPath
impl Unpin for SysPath
impl UnwindSafe for SysPath
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more