[][src]Struct libmedium::hwmon::Hwmons

pub struct Hwmons { /* fields omitted */ }

This crate's central struct. It stores all parsed Hwmons which you can query either by name, device path or index.

Implementations

impl Hwmons[src]

pub fn path(&self) -> &Path[src]

The path that was parsed to generate this object.

pub fn hwmons_by_name(
    &self,
    name: impl AsRef<str>
) -> impl Iterator<Item = &Hwmon>
[src]

Get Hwmons by their name. Returns an empty iterator, if there is no Hwmon with the given name.

pub fn hwmon_by_index(&self, index: usize) -> Option<&Hwmon>[src]

Get a Hwmon by its index. Returns None, if there is no Hwmon with the given index.

pub fn hwmon_by_device_path(
    &self,
    device_path: impl AsRef<Path>
) -> Option<&Hwmon>
[src]

Get a Hwmon by its device path. Returns None, if there is no Hwmon with the given device path.

pub fn iter(&self) -> Iter<'_>[src]

Returns an iterator over all hwmons, their names and their indices.

pub fn parse() -> Result<Self, Error>[src]

Parses /sys/class/hwmon and returns the found hwmons as a Hwmons object.

Trait Implementations

impl Clone for Hwmons[src]

impl Debug for Hwmons[src]

impl<'a> IntoIterator for &'a Hwmons[src]

type Item = (usize, &'a str, &'a Hwmon)

The type of the elements being iterated over.

type IntoIter = Iter<'a>

Which kind of iterator are we turning this into?

Auto Trait Implementations

impl RefUnwindSafe for Hwmons

impl Send for Hwmons

impl Sync for Hwmons

impl Unpin for Hwmons

impl UnwindSafe for Hwmons

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.