Struct sysfuss::SysPath

source ·
pub struct SysPath { /* private fields */ }
Expand description

sysfs root

Implementations§

source§

impl SysPath

source

pub fn path(root: impl AsRef<Path>) -> Self

Initialize with a custom root. Use SysPath::default() to use the default root /.

source

pub fn entities(&self) -> Result<impl Iterator<Item = Result<EntityPath>> + '_>

Get all entities in the system

source

pub fn hwmon_by_name(&self, name: &str) -> Result<HwMonPath>

Find a hardware monitor entry by name

source

pub fn hwmon_by_index(&self, index: u64) -> HwMonPath

Find a hardware monitor entry by index

source

pub fn hwmon( &self, c: impl Capabilities<HwMonAttribute, HwMonAttribute> ) -> Result<impl Iterator<Item = HwMonPath>>

Find a hardware monitor by capabilities

source

pub fn power_supply_by_name(&self, name: &str) -> PowerSupplyPath

Find a power supply entry by name

source

pub fn power_supply( &self, c: impl Capabilities<PowerSupplyAttribute, PowerSupplyAttribute> ) -> Result<impl Iterator<Item = PowerSupplyPath>>

Find a power supply by capabilities

source

pub fn class( &self, class: impl AsRef<Path>, c: impl Capabilities<String, String> ) -> Result<impl Iterator<Item = BasicEntityPath>>

Find entities in a sysfs class by capabilities

Trait Implementations§

source§

impl AsRef<Path> for SysPath

source§

fn as_ref(&self) -> &Path

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Default for SysPath

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.