sinf 0.1.0

Library for obtaining in-depth system information at both the hardware and software levels
Documentation
use crate::ComponentInner;

/// Temperature information for a component.
pub struct Component {
    pub(crate) inner: ComponentInner,
}

impl Component {
    /// Returns the component temperature in degrees Celsius.
    pub fn temperature(&self) -> Option<f32> {
        self.inner.temperature()
    }

    /// Returns the maximum component temperature in degrees Celsius.
    pub fn max(&self) -> Option<f32> {
        self.inner.max()
    }

    /// Returns the highest temperature before the component halts, in degrees Celsius.
    pub fn critical(&self) -> Option<f32> {
        self.inner.critical()
    }

    /// Returns the component label.
    pub fn label(&self) -> &str {
        self.inner.label()
    }

    /// Returns the platform-specific component identifier.
    pub fn id(&self) -> Option<&str> {
        self.inner.id()
    }

    /// Refreshes the component.
    pub fn refresh(&mut self) {
        self.inner.refresh()
    }
}