This commit is contained in:
2026-03-15 19:42:18 +00:00
commit bb39568f01
9 changed files with 535 additions and 0 deletions

25
src/data.rs Normal file
View File

@@ -0,0 +1,25 @@
use std::time::{SystemTime, UNIX_EPOCH};
use rkyv::{Archive, Deserialize, Serialize};
#[derive(Serialize, Deserialize, Archive)]
pub struct Data {
pub data_chunks: Vec<DataChunk>,
pub data_static: BatteryStatic,
}
#[derive(Serialize, Deserialize, Archive)]
pub struct DataChunk {
pub timestamp: i32,
pub battery: BatteryMutable,
}
#[derive(Serialize, Deserialize, Archive)]
pub struct BatteryMutable {
pub charge: i64,
}
#[derive(Serialize, Deserialize, Archive)]
pub struct BatteryStatic {
pub total_capacity: i64,
}