Trait Fan

Source
pub trait Fan: ErrorType {
    // Required methods
    fn max_rpm(&self) -> u16;
    fn min_rpm(&self) -> u16;
    fn min_start_rpm(&self) -> u16;
    fn set_speed_rpm(&mut self, rpm: u16) -> Result<u16, Self::Error>;

    // Provided methods
    fn set_speed_percent(&mut self, percent: u8) -> Result<u16, Self::Error> { ... }
    fn set_speed_max(&mut self) -> Result<(), Self::Error> { ... }
    fn stop(&mut self) -> Result<(), Self::Error> { ... }
}
Expand description

Blocking fan methods

Required Methods§

Source

fn max_rpm(&self) -> u16

Returns the maximum RPM the fan is capable of running at.

Source

fn min_rpm(&self) -> u16

Returns the minimum RPM the fan is capable of running at.

Source

fn min_start_rpm(&self) -> u16

Returns the minimum RPM needed for the fan to begin running from a dead stop (which may be the same as the minimum running speed).

Source

fn set_speed_rpm(&mut self, rpm: u16) -> Result<u16, Self::Error>

Sets the fan’s speed in terms of absolute RPM. Returns the actual RPM set on success.

Provided Methods§

Source

fn set_speed_percent(&mut self, percent: u8) -> Result<u16, Self::Error>

Sets the fan’s speed in terms of percent of maximum RPM. Returns the actual RPM set on success.

Source

fn set_speed_max(&mut self) -> Result<(), Self::Error>

Sets the fan’s speed to the maximum RPM it’s capable of running at.

Source

fn stop(&mut self) -> Result<(), Self::Error>

Stops the fan completely.

Implementations on Foreign Types§

Source§

impl<T: Fan + ?Sized> Fan for &mut T

Source§

fn max_rpm(&self) -> u16

Source§

fn min_rpm(&self) -> u16

Source§

fn min_start_rpm(&self) -> u16

Source§

fn set_speed_rpm(&mut self, rpm: u16) -> Result<u16, Self::Error>

Source§

fn set_speed_percent(&mut self, percent: u8) -> Result<u16, Self::Error>

Source§

fn set_speed_max(&mut self) -> Result<(), Self::Error>

Source§

fn stop(&mut self) -> Result<(), Self::Error>

Implementors§