[][src]Struct macsmc::FanSpeed

pub struct FanSpeed {
    pub actual: Rpm,
    pub min: Rpm,
    pub max: Rpm,
    pub target: Rpm,
    pub safe: Rpm,
    pub mode: FanMode,
}

Collection of various speeds about a single fan. If a sensor is missing, the value is 0.0

Fields

actual: Rpm

The current, actual, speed.

min: Rpm

The slowest that the fan can get.

max: Rpm

The fastest that the fan can get.

target: Rpm

The current target speed. How fast the fan should ideally be.

safe: Rpm

The slowest speed at which the fan is safe to operate. An value of 0.0 means that there is no sensor readout for this value, not that the fan could be turned off.

mode: FanMode

How the fan is currently operating.

Implementations

impl FanSpeed[src]

pub fn percentage(&self) -> f32[src]

The current speed represented as percentage of its max speed. The value is between 0.0 and 100.0

Examples

let fan_speed = FanSpeed {
    actual: Rpm(1000.0),
    max: Rpm(5000.0),
    ..FanSpeed::default()
};

assert_eq!(fan_speed.percentage(), 20.0);

pub fn thresholds(&self) -> [Rpm; 4][src]

Speed threshold for this fan. This divides the [min, max] range into 3 equally sized segments.

Examples

let fan_speed = FanSpeed {
    min: Rpm(1000.0),
    max: Rpm(4000.0),
    ..FanSpeed::default()
};

assert_eq!(fan_speed.thresholds(), [Rpm(1000.0), Rpm(2000.0), Rpm(3000.0), Rpm(4000.0)]);

Trait Implementations

impl Clone for FanSpeed[src]

impl Copy for FanSpeed[src]

impl Debug for FanSpeed[src]

impl Default for FanSpeed[src]

impl PartialEq<FanSpeed> for FanSpeed[src]

impl StructuralPartialEq for FanSpeed[src]

Auto Trait Implementations

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.