Struct 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, HwMonPath>, ) -> 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, PowerSupplyPath>, ) -> Result<impl Iterator<Item = PowerSupplyPath>>

Find a power supply by capabilities

Source

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§

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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.