Struct LMSensors

Source
pub struct LMSensors { /* private fields */ }
Expand description

LM sensors library instance, producing instances of Chips, Buses, etc.

Implementations§

Source§

impl LMSensors

Source

pub fn version(&self) -> Option<&str>

Returns the version of the LM sensors library, if available and valid UTF-8.

Source

pub fn raw_version(&self) -> Option<&CStr>

Returns the raw version of the LM sensors library, if available.

Source

pub unsafe fn new_chip_ref<'sensors>( &'sensors self, chip: &'sensors sensors_chip_name, ) -> ChipRef<'sensors>

Return a new instance of ChipRef, given a shared reference to a raw chip.

§Safety
  • The given sensors_chip_name reference must have been returned from [sensors_get_detected_chips].
Source

pub unsafe fn new_raw_chip(&self, chip: sensors_chip_name) -> Chip<'_>

Return a new instance of Chip, given a raw chip.

§Safety
  • The given sensors_chip_name must have been previously initialized by calling [sensors_parse_chip_name].
Source

pub fn new_chip<'sensors>(&'sensors self, name: &str) -> Result<Chip<'sensors>>

Return a new instance of Chip, given a chip name.

Source

pub fn new_raw_bus(&self, kind: c_short, number: c_short) -> Bus

Return a new instance of Bus, given a raw (bus type, bus number).

Source

pub fn new_bus(&self, kind: Kind, number: Number) -> Bus

Return a new instance of Bus, given a (bus type, bus number).

Source

pub fn default_bus(&self) -> Bus

Return a new default instance of Bus.

Source

pub unsafe fn new_feature_ref<'sensors>( &'sensors self, chip: ChipRef<'sensors>, raw: &'sensors sensors_feature, ) -> FeatureRef<'sensors>

Return a new instance of FeatureRef given a shared reference to a raw feature.

§Safety
  • The given sensors_feature reference must have been returned from [sensors_get_features].
Source

pub unsafe fn new_sub_feature_ref<'sensors>( &'sensors self, feature: FeatureRef<'sensors>, raw: &'sensors sensors_subfeature, ) -> SubFeatureRef<'sensors>

Return a new instance of SubFeatureRef given a shared reference to a raw sub-feature.

§Safety
  • The given sensors_subfeature reference must have been returned either from [sensors_get_all_subfeatures] or from [sensors_get_subfeature].
Source

pub fn chip_iter<'sensors>( &'sensors self, match_pattern: Option<ChipRef<'sensors>>, ) -> Iter<'sensors>

Return an iterator which yields all chips matching the given pattern.

Specifying None for the match_pattern yields all chips.

Trait Implementations§

Source§

impl Debug for LMSensors

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for LMSensors

Source§

fn drop(&mut self)

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.