init
This commit is contained in:
25
src/data.rs
Normal file
25
src/data.rs
Normal 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,
|
||||
}
|
||||
Reference in New Issue
Block a user