[][src]Struct libmedium::Hwmons

pub struct Hwmons<H: Hwmon> { /* fields omitted */ }

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

Implementations

impl<H: Hwmon> Hwmons<H>[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 = &H>[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<&H>[src]

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

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

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

impl Hwmons<ReadOnlyHwmon>[src]

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

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

impl Hwmons<ReadWriteHwmon>[src]

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

Parses /sys/class/hwmon and returns the found hwmons as a Hwmons object. Be sure you have sufficient rights to write to your sensors. Usually only root has those rights.

Trait Implementations

impl<H: Clone + Hwmon> Clone for Hwmons<H>[src]

impl<H: Debug + Hwmon> Debug for Hwmons<H>[src]

impl<'a, H: Hwmon> IntoIterator for &'a Hwmons<H>[src]

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

The type of the elements being iterated over.

type IntoIter = Iter<'a, H>

Which kind of iterator are we turning this into?

Auto Trait Implementations

impl<H> RefUnwindSafe for Hwmons<H> where
    H: RefUnwindSafe

impl<H> Send for Hwmons<H> where
    H: Send

impl<H> Sync for Hwmons<H> where
    H: Sync

impl<H> Unpin for Hwmons<H> where
    H: Unpin

impl<H> UnwindSafe for Hwmons<H> where
    H: UnwindSafe

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.