use rf_core::export::Export; use rf_core::sensor_id::SensorId; use std::any::Any; use std::collections::HashMap; use std::rc::Rc; #[derive(Debug, Clone)] pub struct DeviceState { pub self_id: i32, pub exports: HashMap, pub local_sensor: HashMap>>, pub nbr_sensor: HashMap>>>, } impl DeviceState { pub fn update_exports(&mut self, nbr: i32, export: Export) { self.exports.insert(nbr, export); } } #[derive(Debug, Clone)] pub struct Topology { pub devices: Vec, pub states: HashMap, } impl Topology { pub fn new(devices: Vec, states: HashMap) -> Self { Topology { devices, states } } }