diff --git a/bin/map/src/node_info.rs b/bin/map/src/node_info.rs new file mode 100644 index 000000000..06ef3eb42 --- /dev/null +++ b/bin/map/src/node_info.rs @@ -0,0 +1,30 @@ +//TODO: made node_id into a HashSet(u32) +// wrap NodeInfo and NodeId in a Mutex + +pub type NodeId = u32; + +#[derive(Clone)] +pub struct NodeInfo { + pub id: String, + pub connections: usize, + pub is_active: bool, + pub last_message: String, +} + +impl NodeInfo { + pub fn new() -> NodeInfo { + let connections = 0; + let is_active = false; + NodeInfo { id: String::new(), connections, is_active, last_message: String::new() } + } +} + +impl Default for NodeInfo { + fn default() -> Self { + Self::new() + } +} + +//pub async fn add_seen(&self, id: u32) { +// self.privmsg_ids.lock().await.insert(id); +//}