use crate::devices::device::DeviceRelayID; /// # RelayStateHistory /// /// This structures handles the manipulation of relay state history files /// /// These file are binary file optimizing used space. pub struct RelayStateHistory { id: DeviceRelayID, day: usize, buff: Vec, } impl RelayStateHistory { /// Open relay state history file, if it exist, or create an empty one pub fn open(id: DeviceRelayID, day: usize) -> anyhow::Result { todo!() } /// Create a new in memory dev relay state history fn new_memory(id: DeviceRelayID, day: usize) -> Self { todo!() } /// Resolve time offset of a given time in buffer fn resolve_offset(&self, time: i64) -> anyhow::Result<(usize, u8)> { todo!() } /// Set new state of relay fn set_state(&mut self, time: i64, on: bool) -> anyhow::Result<()> { todo!() } /// Get the state of relay at a given time fn get_state(&self, time: i64) -> anyhow::Result { todo!() } /// Persist device relay state history pub fn save(&self) -> anyhow::Result<()> { todo!() } }