asic_rs/data/
fan.rs

1use crate::data::serialize;
2use measurements::AngularVelocity;
3use serde::{Deserialize, Serialize};
4use serialize::serialize_angular_velocity;
5
6#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
7pub struct FanData {
8    /// The position or index of the fan as seen by the device
9    /// Usually dependent on where to fan is connected to the control board
10    pub position: i16,
11    /// The RPM of the fan
12    #[serde(serialize_with = "serialize_angular_velocity")]
13    #[serde(skip_serializing_if = "Option::is_none")]
14    pub rpm: Option<AngularVelocity>,
15}