mirror of
https://codeberg.org/icewind/taspromto.git
synced 2026-08-02 12:14:45 +02:00
formattable trait
This commit is contained in:
parent
7955380859
commit
e13243f9a5
6 changed files with 36 additions and 18 deletions
|
|
@ -5,6 +5,8 @@ use std::str::FromStr;
|
|||
|
||||
use serde::{Deserialize, Deserializer, de::Error};
|
||||
|
||||
use crate::device::FormattableDevice;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct TempState {
|
||||
pub name: String,
|
||||
|
|
@ -22,8 +24,10 @@ impl TempState {
|
|||
humidity: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn format_open_metrics(&self) -> impl Display + '_ {
|
||||
impl FormattableDevice for TempState {
|
||||
fn format_open_metrics(&self) -> impl Display + '_ {
|
||||
TempFormatter { device: self }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue