use ComponentExt;
pub struct Component {
temperature: f32,
max: f32,
critical: Option<f32>,
label: String,
}
impl Component {
pub fn new(label: String, max: Option<f32>, critical: Option<f32>) -> Component {
Component {
temperature: 0f32,
label: label,
max: max.unwrap_or(0.0),
critical: critical,
}
}
}
impl ComponentExt for Component {
fn get_temperature(&self) -> f32 {
self.temperature
}
fn get_max(&self) -> f32 {
self.max
}
fn get_critical(&self) -> Option<f32> {
self.critical
}
fn get_label(&self) -> &str {
&self.label
}
}
pub fn get_components() -> Vec<Component> {
Vec::new()
}